What are the components of the parameter definition

Assignment Help Programming Languages
Reference no: EM133356285

Object oriented programming

Section A

Indicate whether each of the following C# programming language identifiers is legal or illegal. If it is legal, indicate whether it is a conventional identifier for a class.

a.electricBill

g.Ay56we

b.ElectricBill

h.Ticket

c.Electricbill

i.    212AreaCode

d.Static

j.    heightInCentimeters

e.void

k.Zip23891

f.    #ssn

l.    Void

How is a named constant different from a variable? How would you create a named constant? Show an example.

For a method that accepts a parameter, what are the components of the parameter definition that must be included in the method declaration? Show an example of a method declaration with a parameter.

Show an example of a class definition that creates a subclass of an existing Employee class, and adds a private double field called commissionRate. What is the total set of fields that an instance of the new class contains?

Section B
Australian car rental centre Kayak charges $30 per day plus 15 cents per mile. Write a C# program that prompts the user for and accepts a number of days and miles driven and call method named CarRental to calculate and then display the total rental fee.

Write a program named Admission for a college's admissions office. The user enters a numeric high school grade point average (for example, 3.2) and an admission test score. Display the message Accept if the student meets either of the following requirements:
A grade point average of 3.0 or higher, and an admission test score of at least 60
A grade point average of less than 3.0, and an admission test score of at least 80
If the student does not meet either of the qualification criteria, display Reject.

Complete the following C# code to find the sum of all elements of an array.

Write an example method that overrides the + operator to create a new book whose title is a concatenation of the titles of two books. For example, if the first book's title is "The Adventures of Tom Sawyer" and the second book's title is "The Adventures of Huckleberry Finn", the concatenated title will be "The Adventures of Tom Sawyer and The Adventures of Huckleberry Finn". Assume the book class is defined as:

Section C
Read what is required from each question carefully and answer all parts of the question.

Create an application named PhotoStudio that instantiates objects of three classes named Photo, MattedPhoto, and FramedPhoto and that demonstrates all their methods.

Create a class named Photo that includes fields for width and height in inches and properties for each field. Include a protected field for price and protected method that set price to $3.99 for an 8-inch by 10-inch photo, $5.99 for a 10-inch by 12-inch photo, and $9.99 for any other size. The price field requires a get accessor but no set accessor. Also include a ToString() method that returns a string constructed from the return value of the object's GetType() method and the values of the fields.

Extend the Photo class (from the question 1) to two more specialized classes: MattedPhoto and FramedPhoto. The MattedPhoto class includes a string field to hold a color, and the FramedPhoto class includes two string fields that hold the frame's material (such as silver) and style (such as modern). The price for a MattedPhoto increases by $10 over its base cost, and the price for a FramedPhoto increases by $25 over its base cost. Each subclass should include a ToString() method that overrides the parent class version.

Reference no: EM133356285

Questions Cloud

Most profitable airline companies stand out : What are the factors that make the most profitable airline companies stand out - Contribution and Revise and position your claim
Articulate how biased perspectives presented in primary : Articulate how biased perspectives presented in primary and secondary sources influence what is known or unknown about history. The United Nations
What accounts for the social stability of the system : Given the diversity of experience and opinion in the United States, what accounts for the social stability of the system? How might we explain recent rises
How your feminism will solve that problem : how your feminism will solve that problem. it can be post-modern feminism, liberal feminism, transnational feminism, whichever is easier
What are the components of the parameter definition : What are the components of the parameter definition that must be included in the method declaration? Show an example of a method declaration with a parameter
Make up the largest group of federal hospitals : We learned that Public Hospitals are owned by the government and that VA hospitals make up the largest group of federal hospitals.
Demonstrate political integrity-to honour through action : how and why YOU (not the government or Canadians) should/could honour Indigenous understandings of the concept assigned to your section while you are living
Groups or services were used in providing carer support : What type of groups or services were used in providing carer support? Which approach discussed produced the most effective response? Why?
Explain how good the american dream is : Explain How good the American Dream is? Explain connection from Crucible why American Dream is Good? Explain connection from Constitution of the Iroquois Nation

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd