Robotics C++ Physics II AP Physics B Electronics Java Astronomy Other Courses Summer Session  

 

Exercises

 

 

Exercise 1

Exercise 2

Exercise 3

Exercise 4

 

 

Exercise 1

 

Run Restaurant 3 except use the code provided earlier to round off the bill to two decimal places

 

Exercise 2

 

Run Restaurant 5 with the following change:

 

In the main program, prompt the user for the number of cokes, fries, and burgers. Use the same values as "hard wired" and check to see if you get the same answer as in the example - you should.

 

Exercise 3 (in same file)

 

n Create a class named Trigonometry that is used to find the following

       Area and circumference of a circle, with input of radius by the user

       Area and circumference of a rectangle, with input of sides by the user

       Volume of a sphere, with input of radius by the user

n Place all function definitions outside of the class

n Include a public and a private section in the class with appropriate components

n Add code in the main function to print all of the quantities, appropriately labeled, along with the input data

 

Exercise 4 (in separate files)

 

n Repeat exercise 2 above except place the code in the following 3 separate files in the same directory, named as follows

       TrigDriver - this file contains the main

       Trigonometry - this file contains the class, the prototypes - the public and private sections 

       TrigImplementation - this file contains the function definitions