Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Follow the instructions for starting your C++ development tool. Depending on the development tool you are using, you may need to create a new project;

Follow the instructions for starting your C++ development tool. Depending on the development tool you are using, you may need to create a new project; if so, name the project Lab7-2 Project, and save it in the Cpp8\Chap07 folder. Enter the instruc- tions shown in Figure 7-44 in a source file named Lab7-2.cpp. (Do not enter the line numbers.) Save the file in either the project folder or the Cpp8\Chap07 folder. Now follow the appropriate instructions for running the Lab7-2.cpp file. Test the program using 125000 as the current sales amount. If necessary, correct any bugs (errors) in the program.

1 //Lab7-2.cpp - Displays the number of years required 2 //for a company's sales to reach at least $150,000 3 //using a 5.5% annual growth rate. Also displays 4 //the sales at that time. 5 //Created/revi sed by on 6 7 #include 8 #include 9 using namespace std; 10 11 int main() 12 { 13 const double GROWTH_RATE = 0.055; 14 double sales = 0.0; 15 double annual Increase = 0.0; 16 int years = 0; 17 18 cout "Current year's sales: "; 19 cin sales; 20 while (sales < 150000.0) 21 { 22 annual Increase = sales * GROWTH_RATE; 23 sales += annual Increase ; 24 years += 1; 25 } //end while 26 27 cout fixed setprecision(O) ; 28 cout "Sales " years " years from now: $" 29 sal es endl ; 30 31 return 0; 32 } //end of main function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago

Question

9. Power and politics can be destructive forces in organizations.

Answered: 1 week ago