Question: For loop help InstructionThe following code had been written for you #include using namespace std; int main(){ double v, p, a, e; double shark1, shark2,

For loop help

InstructionThe following code had been written for you

#include  using namespace std; int main(){ double v, p, a, e; double shark1, shark2, shark3, shark4; int s; cout<< "Please enter the company value: "; cin>>v; cout<< "please enter the value added for shark 1: "; cin>>shark1; cout<< "please enter the value added for shark 2: " ; cin>>shark2; cout<< "please enter the value added for shark 3: "; cin>>shark3; cout<< "please enter the value added for shark 4: "; cin>>shark4; 

Instruction

Your task is to write main loop for the program. Your loop will do three things:

1. Ask for inputs for price, equity, and shark number using the following prompts

"Please enter the price: "

"Please enter the equity: "

"Which shark (1,2,3,4): "

2. Calculate the value for a given shark using the formula "p - e*v + a*v" where...

p = Price

e = Equity

v = Value

a = Shark value

3. Output that final value, which looks like this:

"The final value would be XXXXX" (XXXXX is your value)

Your program should stop if the entrepreneur puts in zero for the price. You may also assume the entrepreneur will enter 0 for both the equity amount and shark number as well, but this should not affect the output of your program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!