jeudi 8 octobre 2015

Ruby application with user input that calculates food order with tax and discount

I have an assignment to write an application with Ruby.

The guidelines are as follows:

Write a Ruby program that calculates costs for a new food service provider. Meal prices are based on the type of burger ordered ($2.00 for a plain burger, $2.50 for a cheeseburger, $4.00 for a double burger and $5.00 for a double burger with cheese), whether fries and a drink are desired ($2 more for fries and a drink), Total meal charges will get discounted based on large parties (5% reduction for ten or more burgers ordered), and whether the diner is an SMC student ($0.50 reduction per burger ordered). Be sure to add 8.25% sales tax to get the total bill. Be sure your program does not allow negative data or for the number of fries and drinks ordered to exceed the number of burgers ordered.

I'm a total newb to OOP and this assignment was given on the first week of class. Where do I start? I know i need to use the "gets.chomp" method for the user input but after that, do i use while loop? and how can I structure the if, elsif, else block to execute this correctly? ANY help would be appreciated.

Aucun commentaire:

Enregistrer un commentaire