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;
- using System.Threading.Tasks;
- namespace P04VendingMachine
- {
- class Program
- {
- static List<VendingItemClass> items = new List<VendingItemClass>();
- static void Main(string[] args)
- {
- FillMachine();
- }
- static void FillMachine() //will instantiate objects of type VendingItemClass for each item.
- //store in a List of VendingItemClass called items.
- {
- }
- static void DisplayMachine()
- {
- int moneyInserted;
- //sean code until Bills inserted () part
- int i = 0;
- while (i < items.Count)
- {
- Console.Write("~".PadRight(3));
- Console.Write(items[i].location + ": " + items[i].item + " ".PadRight(20));
- Console.Write(items[i + 1].location + ": " + items[i + 1].item + " ".PadRight(20));
- Console.WriteLine("~");
- Console.Write("Price $" + items[i]price.PadLeft(20);
- Console.WriteLine("Bills Inserted ($1, $2, $5, or 0 to end): "); //Machine will only take paper money in 1/2/5. only 1 bill per transaction
- moneyInserted = Console.Read();
- //if (moneyInserted != 1 || moneyInserted != 2 || moneyInserted != 5) find out if error checking.
- // Console.WriteLine("")
- Console.WriteLine("You Have inserted {0}. Please make your selection:", moneyInserted);
- }
- }
- static void MakeChange() //pass the object and money into here and return a strnig to display their change.
- {
- Console.WriteLine("Your change is {0}");
- VendingItemClass.ReduceInventory();
- DisplayMachine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement