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

  Recursive method to read in string of characters

Trying to write a recursive method that reads in a string of characters and checks to see if the first character is either a 'D' or and 'E', then is followed by a string of one or more 'F's.

  Write program to initializes array with ten random integers

Write a program which initializes the array with ten random integers and then prints four lines of output, containing: - Every element at an even index.

  Design recursive functions using base and recursive cases

Understand the functional model in which a program is a set of nested expressions and Design recursive functions using base and recursive cases

  Write a program to display the count on the screen

Write a program that reads a text from the keyboard until the user presses the "Enter" key. Your program must count the number of uppercase alphabets.

  Invoke method to tell air conditioner object to turn on

Assume there is a reference variable myAC to an object of this class, which has already been created. Using the reference variable, invoke a method to tell the air conditioner object to turn on.

  Write script to declare-set variable equal to total balance

Write down the script which declares and sets variable that's equal to total outstanding balance due. If that balance due is greater than $10,000.00

  Build your own maze

Build your own maze and make it so easy so i can understand it. try to use for while statement. it is an easy task so please do not make it complicated and follow the instructions that im going to post. another thing do not use the maze that in th..

  Explain calling functions and pass functions by value

I need to create 2 functions which passe their values when they are called in main.

  NIT3202 Data Analytics for Cyber Security Assignment

NIT3202 Data Analytics for Cyber Security Assignment Help and Solution, Victoria university - Assessment Writing Service

  Create class has constructor to reduce function of fraction

Create a class RationalNumber (fractions) with the following functionality: Has a constructor that prevents a 0 denominator in a fraction and calls the reduce function to simplify the fraction

  Determine where they fall within the model and why

Discussion: Generational Languages- Choose two other languages within your industry. Determine where they fall within the model and why.

  Write a shell script program with a menu in linux

Write a shell script program with a menu in Linux that does the following: List the current directory. Discuss about microkernels

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