c++ buying spree

c++ buying spree - /*Fanny Y. Student. Cmpsc 101. Prompt...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 /*Fanny Y. Student. Cmpsc 101. Prompt the user for the number of Macs needed, the number of PCs needed and the number of printers needed.*/ #include<iostream> using namespace std int main() { const double budget = 25000 double budget_left const double macPrice = 1100, pcPrice = 900, printerPrice = 220.25 double mac_num, pc_num, printer_num double mac_amount, pc_amount, printer_amount, total_amount cout<<"Welcome to my store. "<<endl cout<<"You currently have a total of $25,000 to spend. "<<endl<<endl cout<<"ITEMS: "<<endl cout<<"MAC: $1,100"<<endl cout<<"PC: $900"<<endl cout<<"PRINTER: $220.25"<<endl cout<<"Enter the amount of MACs, PCs, or/and printers you need. "<<endl<<endl cout<<"Enter the number of MACs needed: " cin>>mac_num mac_amount = mac_num * macPrice cout<<"Enter the number of PCs needed: " cin>>pc_num pc_amount = pc_num * pcPrice cout<<"Enter the number printer needed: " cin>>printer_num printer_amount = printer_num * printerPrice total_amount = mac_amount + pc_amount + printer_amount
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

c++ buying spree - /*Fanny Y. Student. Cmpsc 101. Prompt...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online