Need Help with my code

i need help fixing this anyone wanna help

//variables double origAmount = 0; double interest; double total; int paymentchoice; string input = ""; double monthPay;

 //loop while (input != "exit") { //Display Menu Console.WriteLine("\t\t**********************************"); Console.WriteLine("\t\t* Hire Purchase Calculator *"); Console.WriteLine("\t\t**********************************"); Console.WriteLine("\tPlease use 1 of the options on the screen"); Console.WriteLine(""); Console.WriteLine("\t1) Immediate Payment (10% Reduction"); Console.WriteLine(""); Console.WriteLine("\t2) Medium Term Payment (10% Increase, 12 Months"); Console.WriteLine(""); Console.WriteLine("\t3) Long Term Payment (30% Increase, 36 Months"); Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine("\t\t__________________________________"); Console.WriteLine("\t\tPLease Enter Your Payment Method:"); paymentchoice = Convert.ToInt32(Console.ReadLine()); Console.Clear(); //The immediate payment plan if (paymentchoice == 1) { total = origAmount * 0.9; //menu Console.Clear(); Console.WriteLine("\t\t**********************************"); Console.WriteLine("\t\t* Hire Purchase Calculator *"); Console.WriteLine("\t\t**********************************"); Console.WriteLine("\t\tPlease enter the orginal amount"); origAmount = Convert.ToDouble(Console.ReadLine()); Console.Clear(); total = origAmount * 0.9; Console.WriteLine("\t\t**********************************"); Console.WriteLine("\t\t* Hire Purchase Calculator *"); Console.WriteLine("\t\t**********************************"); Console.WriteLine(""); Console.WriteLine("\t\tTotal to be paid :" + total); Console.WriteLine("\t\tMonthly payment :" + "0"); //just entered "0" because the value will be 0 anyway Console.WriteLine("\t\tTotal interest to be paid :" + "0"); //sameway as the previous line was done put a 0 in because it will be 0 anyway Console.WriteLine(""); Console.WriteLine("\t\tPress y to go to menu"); input = Convert.ToString(Console.ReadLine()); Console.Clear(); //Restart the program //if y is pushed it repeats the program again unless any other key is pushed if (input == "y") { } else if (input == "n") { break; } else { Console.Clear(); Console.WriteLine("Please enter one of the two letters y & n"); Console.WriteLine("Press any key to return"); Console.ReadKey(); Console.Clear(); } //The medium term plan if (paymentchoice == 2) { //Menu Console.Clear(); Console.WriteLine("\t\t**********************************"); Console.WriteLine("\t\t* Hire Purchase Calculator *"); Console.WriteLine("\t\t**********************************"); Console.WriteLine("\t\tPlease enter the orginal amount"); origAmount = Convert.ToDouble(Console.ReadLine()); Console.Clear(); total = origAmount * 1.1; monthPay = origAmount / 12.0; interest = origAmount * 0.1; Console.WriteLine("\t\t**********************************"); Console.WriteLine("\t\t* Hire Purchase Calculator *"); Console.WriteLine("\t\t**********************************"); Console.WriteLine(""); Console.WriteLine("\t\tTotal to be paid :" + total); Console.WriteLine("\t\tMonthly payment :" + monthPay); Console.WriteLine("\t\tTotal interest to be paid :" + interest); Console.WriteLine(""); Console.WriteLine("\t\tPress y to go to menu"); input = Convert.ToString(Console.ReadLine()); Console.Clear(); //Restart the program if (input == "y") { } else if (input == "n") { break; } else { Console.Clear(); Console.WriteLine("Please enter one of the two letters y & n"); Console.WriteLine("Press any key to return"); Console.ReadKey(); Console.Clear(); } if (paymentchoice == 3) { total = origAmount * 1.3; monthPay = origAmount / 36.0; interest = origAmount * 0.3; //menu Console.Clear(); Console.WriteLine("\t\t**********************************"); Console.WriteLine("\t\t* Hire Purchase Calculator *"); Console.WriteLine("\t\t**********************************"); Console.WriteLine("\t\tPlease enter the orginal amount"); origAmount = Convert.ToDouble(Console.ReadLine()); Console.Clear(); total = origAmount * 1.3; monthPay = origAmount / 36.0; interest = origAmount * 0.3; Console.WriteLine("\t\t**********************************"); Console.WriteLine("\t\t* Hire Purchase Calculator *"); Console.WriteLine("\t\t**********************************"); Console.WriteLine(""); Console.WriteLine("\t\tTotal to be paid :" + total); Console.WriteLine("\t\tMonthly payment :" + monthPay); Console.WriteLine("\t\tTotal interest to be paid :" + interest); Console.WriteLine(""); Console.WriteLine("\t\tPress y to go to menu"); input = Convert.ToString(Console.ReadLine()); Console.Clear(); //Restart the program if (input == "y") { } else if (input == "n") { break; } else { Console.Clear(); Console.WriteLine("Please enter one of the two letters y & n"); //if the users enters anything that is not y or n to restart or end the program they will be prompt Console.WriteLine("Press any key to return"); //they will be prompt by this message Console.ReadKey(); Console.Clear(); } } 

by seanmac4398 via /r/csharp

Leave a Reply