Question: Write a C++ program that calculates the purchase for video game sales. New games are $9.95 and all others $7.95. If a customer buys more

Write a C++ program that calculates the purchase for video game sales. New games are $9.95 and all others $7.95. If a customer buys more than 3 video games, the fourth one is free. Ask the user how many video games the customer is purchasing. Ask the user whether the video game is a new release. Then display the total of the purchase.

I think answer is :

#include

using namespace std;

int main() { int games, type; double cost = 0; cout << "Enter the amount of video games bought : " << end1; cin >> games; for(int i = 0; i < games;i++){ if ((i+1) % 4==0) cout << "Every 4th game is free of cost" << end1; else{ cout <<"1.New Game 2. Other: Enter type of game: " end1; cin >> type; if (type =1) cost = cost + 9.95; else cost = cost + 7.95; } } cout <<"Total cost for"<<"games"<<"games is $"<< cost; return 0; }

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!