Question
Using any standard C++ compiler write your program (aka. source) code, compile and debug your program until you show the correct program output. Submit your
Using any standard C++ compiler write your program (aka. source) code, compile and debug your program until you show the correct program output. Submit your "source code" to the programming questions below by saving them as a .cpp file and attaching them to the file submission area below. For the short answer questions, type your brief responses to the questions in a text editor and submit them as a text file (.txt extension).
Name your files as follows: Las tName_11.cpp, Las tName_12.cpp, Last Name_13.cpp, Last Name_14.txt
Complete all parts of this assignment prior to clicking submit.
1.1 A Diamond Pattern -
Write a program that that display the following pattern. (see Gaddis text Ch#2 Programming challenge 15)
* *** ***** ******* ***** *** *
1.2 Total purchase -
A customer in a store is purchasing five items. The prices of the five items are:
Price of item 1 = $12.95 Price of item 2 = $24.95 Price of item 3 = $6.95 Price of item 4 = $14.95 Price of item 5 = $3.95
Write a program that holds the prices of the five items in five variables. Display each item's price, the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6%. See below a sample screen output, after a successful "build and run" using the Code::Block IDE.
Item 1: $12.95 Item 2: $24.95 Item 3: $6.95 Item 4: $14.95 Item 5: $3.95 Subtotal: $63.75 Sales tax: $3.825 Total: $67.575 Process returned 0 (0x0) execution time : 0.050 s Press any key to continue. |
1.3 Distance per Tank of Gas
A car with a 20-gallon gas tank averages 21.5 miles per gallon when driven in town and 26.8 miles per gallon when driven on the highway. Write a program that calculates and displays the distance the car can travel on one tank of gas when driven in town and when driven on the highway.
Hint: The following formula can be used to calculate the distance:
Distance=Number of Gallons x Average Miles Per Gallon.
See below a sample screen output, after a successful "compile and run" using the wxDev-C++ IDE.
Town: 430 Highway: 536 Press any key to continue . . . |
1.4 Review Questions and Exercises
Complete Gaddis textbook Chapter 1 Review Questions and Exercises 1 - 29 and Chapter 2 Review Questions and Exercises 1 - 26. Upload a .txt file with just your brief responses to the selected questions from assigned chapter RQE's.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started