Integer variables totalBudget and productCost are read from input. A product costs productCost to make, and a budget is given by totalBudget. Assign remainingBudget with the remaining budget after making as many products as possible. Ex: If the input is 13 4, then the output is: Remaining budget: 1 1 #include 2 using namespace std; 3 4 int main() { 5 6 7 8 9 10 11 12 13 14 15 16 17 } int totalBudget; int product Cost; int remainingBudget; cin >> totalBudget; cin >> productCost; /* Your code goes here */ cout << "Remaining budget: " << remainingBudget << endl; return 0;

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 13PE
icon
Related questions
Question

Code is for C++

Integer variables totalBudget and product Cost are read from input. A product costs productCost to make, and a budget is given
by totalBudget. Assign remaining Budget with the remaining budget after making as many products as possible.
Ex: If the input is 13 4, then the output is:
Remaining budget: 1
1 #include <iostream>
2 using namespace std;
3
4 int main() {
5
6
7
8
9
10
11
12
13
14
15
16
17}
int totalBudget;
int product Cost;
int remainingBudget;
cin >> totalBudget;
cin >> product Cost;
/* Your code goes here */
cout << "Remaining budget: " << remainingBudget << endl;
return 0;
Transcribed Image Text:Integer variables totalBudget and product Cost are read from input. A product costs productCost to make, and a budget is given by totalBudget. Assign remaining Budget with the remaining budget after making as many products as possible. Ex: If the input is 13 4, then the output is: Remaining budget: 1 1 #include <iostream> 2 using namespace std; 3 4 int main() { 5 6 7 8 9 10 11 12 13 14 15 16 17} int totalBudget; int product Cost; int remainingBudget; cin >> totalBudget; cin >> product Cost; /* Your code goes here */ cout << "Remaining budget: " << remainingBudget << endl; return 0;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr