Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Paper_Problem
- {
- class Program
- {
- static void Main(string[] args)
- {
- int reportlength = 140;
- int meetingmembers = 25;
- int ream = 500;
- int paperneeded = (meetingmembers + 5) * reportlength;
- float reamsneeded = (paperneeded / 500) + 1;
- int cartridgesneeded = (paperneeded / 1200) + 1;
- Console.WriteLine("You need a total of {0} reams of paper and {1} ink cartridges.", reamsneeded, cartridgesneeded);
- string userInput;
- int cartridgecount;
- int reamcount;
- Console.WriteLine("How many Ink cartridges would you like to buy?");
- userInput = Console.ReadLine();
- cartridgecount = Int32.Parse(userInput);
- Console.WriteLine("How many reams of paper would you like to buy?");
- userInput = Console.ReadLine();
- reamcount = Int32.Parse(userInput);
- double reamcost = 49.99;
- double cartridgecost = 12.99;
- double cartridgetotal = cartridgecount * cartridgecost;
- double reamtotal = reamcost * reamcount;
- double totalcost = reamtotal + cartridgetotal;
- if (cartridgecount >= 5 && reamcount >= 5)
- {
- double discounttotal = totalcost / 10;
- double discountsaved = totalcost - discounttotal;
- Console.WriteLine("{0} Total", discounttotal);
- Console.WriteLine("{0} Ink Cartridges {1}", cartridgecount, cartridgecost);
- Console.WriteLine("{0} Reams of paper {1}", reamcount, reamcost);
- Console.WriteLine("You have saved a total of {0}", discountsaved);
- Console.ReadLine();
- }
- else
- {
- Console.WriteLine("{0} Total", totalcost);
- Console.WriteLine("{0} Ink Cartridges {1}", cartridgecount, cartridgecost);
- Console.WriteLine("{0} Reams of paper {1}", reamcount, reamcost);
- Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement