Question: In C++, ASAP please! Create a CodeBlocks project with a file main.cpp. Write a program to calculate the price of 5 chickens, each chicken cost
In C++, ASAP please!
Create a CodeBlocks project with a file main.cpp.
Write a program to calculate the price of 5 chickens, each chicken cost $7.25 and then display result:
Write a short description comment at the top of the code.
1-Define an integer-typed variable chickenCount and set the value to 5.
2-Define a double-typed variable chickenPrice and set the value to 7.25
3-Define a variable named totalPrice.
4-Calculate the total price by using multiplication and set the value of variable totalPrice
5-Display the result in the format like this
The total price of X chickens (cost YY.YY each) is $ZZ.ZZ
where X is the count of chicken, YY.YY is cost of each chicken, and ZZ.ZZ is the totalPrice
For example:
The total price of 5 chickens (cost 7.25 each) is $36.25
Test your code with different values of counts and prices.
When you change the values of the variables chickenCount and chickenPrice, the output should be correct WITHOUT changing the "cout" statements.
For example, with chicken count 7 and cost 8.99, the output should be:
The total price of 7 chickens (cost 8.99 each) is $62.93
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
