Write the
appropriate C++ statements to march the description in the following comments:
// declare two integer variables feet and inches
// ask the user how many feet and inches tall they are(no fraction)
//input the feet and inches
//assign inches, the value of inches plus feet times 12
// output with appropriate message the number of inches the person is tall.
Real Estate
Project
Imagine you are a real estate
agent and make your living from the sales commissions. House commission paid to
sell a house through multiple listings are 6%. The listing agency receives 3%
and selling agency receives 3%. Of that 3%, each agency gets 1.5% and the
selling agent or listing agent gets 1.5%. As a real estate agent, you want to know
how much you will receive for a house that you either list or sell. For your
record, identify the house by the owners's last name. Write a program that ask
the user for the name and selling price of the home. Calculate the amount paid
by the homeowner to sell the home and the amount of the commission you will
receive. Use constant for the commission rate (const dataType variableName =
value;). Be sure to include all preprocessor directions that you need. Your
program should include appropriate comments. Drop your project in my digital
drop box. Have fun. See you on Tuesday.
getAndIgnoreProject
|
|
|
usingGetlineFunction
Write a complete C++ program
that ask the user to enter his or her name, street address, and city, state,
and zip code into three strings variables. Then print out the strings as you
would to address an envelope. After executing your program, select and copy
everything that appears on your screen. Copy and paste text into a comment
block at the end of your program. Save the program as getlineProject.cpp, then
put the completed program and output in my digital drop box.
You may use the following program design:
//program comments
//use the correct preprocessor directive for input/output
//open the main function with the correct heading
//declare three variables to read in the name, the entire street address, and
the combined city, state, and zip.
//ask the user to enter his/her complete name
//use the getline() function to read in the name
//ask the user for his/her complete street address
//use the getline() function to read in the street address
//ask the user for his/her complete city, state, and zip code
//use the getline() function to read in the city, state, and zip code into 1
string
//display on 3 lines the name, street address, city, state, and zip
//write the return statement
//close the main function
Using Input
Output File
Suppose you are ordering
merchandise for a small gift shop. The wholesaler requires that you send your
order as a file over a modem. Create your order file by entering from the
keyboard and writing to an output file. The order information consist of the
number of items, the wholesale cost, and the description per line or record.
Create an output file named order.out. When writing this file, separate each
entry with a blank and use an endl after each description. Output files do not
have column headings. Those are only shown for clarity in the assignment. After
executing your program, select and copy everything that appears on your screen.
Copy and paste text into a comment block at the end of your program. Save the
program as FileProject.cpp, then put the completed program and output in my
digital drop box.
Create a file with the following information:
Number of items Wholesale Cost Description
5 4.49 Pencil Sharpener
2 12.00 Designer folder
Program execution should look something like the following example.
The prompt and user input from keyboard should resemble:
Enter your first data item by quantity, cost, description separated by a blank
5 4.49 Pencil sharpener
Enter your second data item by quantity, cost, description separated by a blank
2 12.00 Designer folder
There is no screen output. The order.out file should resemble:
5 4.49 Pencil sharpener
2 12.00 Designer folder
You may use the following program design:
//program comments
//use the correct preprocessor directive for input/output
//open the main function with the correct heading
//declare 4 variables to read in the quantity, cost, and description, and a
file variable for output
//open the output file
//prompt the user to enter quantity, cost and description separated by a blank
//use cin to input quantity and cost
//use the getline() function to input the description
//write to your output file quantity, a blank, cost, a blank, description, and
endl
Police Radar
Gun
Write a program to stimulate a
police radar gun. The program should read an automobile speed and display the
message “warning” if the speed exceeds the posted limit by less than 10 miles.
If the automobile exceeds the speed limit by 10 miles per hour or more, the
message “ticket” is displayed. If the automobile is within the speed range,
nothing is displayed.
Planet
Planet Multiply by Mercury 0.37 Venus 0.88 Mars 0.38 Jupiter 2.64 Saturn 1.15 Uranus 1.15 Neptune 1.12 Pluto 0.04 Modify
your program to allow the user to repeatedly choose another until he/she do
not want to choose again. That means add an exit to your menu. Save your
program as Planets.cpp |
|||||
Integer
Problem Hospital
Billing Taxes
|