Results 1 to 3 of 3
Thread: Help designing a program
- 09-24-2010, 01:33 AM #1
Member
- Join Date
- Sep 2010
- Posts
- 5
- Rep Power
- 0
Help designing a program
My professor wants us to write a program that will allow a user to build their own quesadilla, selecting y/n for each part. He also wants us to use constants.
This is what I have:
All the prices and such were given to us. Basically I need to ask the user to input either y or n for each item, then have the program check what was inputted, and if y was inputted I have to add the value of the constant to n1, then at the end just display n1.Java Code:import java.util.Scanner; public class Quesadila { public static final double GRILLED_VEGETABLES = 1; public static final double SPINACH = 1; public static final double BROCCOLI = 1; public static final double SPICY_BEEF = 2; public static final double SHREDDED_CHICKEN = 2; public static final double PICADILLO = 2; public static final double GRILLED_CHICKEN_BREAST = 2.25; public static final double IN_A_CHILI_SAUCE = 2.25; public static final double SHRIMP_WITH_SPICY_RED_SALSA = 3; public static void main(String[] args) { int n1; n1 = 5; System.out.println("Welcome to Build a Quesadilla!"); System.out.println("Here are your options:"); System.out.println("Basic Quesadilla: $5"); System.out.println("Add Grilled Vegetables, Spinach, or Broccoli: $1 each"); System.out.println("Add Spicy Beef, SHredded Chicken, or Picadillo: $2 each"); System.out.println("Add Grilled Chicken Breat or In a Chili Sauca: $2.25 each"); System.out.println("Add Shrimp with Spicy Red Salsa: $3"); System.out.println("Do you want Grilled Vegetables (y/n)?"); } }
If anyone could get me started in the right direction I'd really appreciate it.
- 09-24-2010, 02:09 AM #2
have you learned about functions yet?
and, shouldn't n1 be a double ?
- 09-24-2010, 02:31 AM #3
Similar Threads
-
Problem in JSP Page Designing
By vinothkumarrvk in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 03-10-2010, 06:16 AM -
help with designing Java program:file browser w/ regex search, possibly media player?
By jmd9qs in forum New To JavaReplies: 0Last Post: 11-04-2009, 09:09 PM -
designing application in swing
By programmer_007 in forum AWT / SwingReplies: 12Last Post: 09-03-2009, 07:50 PM -
Need help for coding and designing
By g.ganiraju in forum New To JavaReplies: 11Last Post: 11-01-2008, 04:49 AM -
advise on designing an ejb application
By bobD in forum New To JavaReplies: 0Last Post: 09-03-2008, 09:04 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks