Part A: Setup your Business 1. Create a new Java file called ITSC1212Lab13.java: a. Make sure you have a main method 2. Start by deciding the following and putting them into your file as comments: a. The name of your food service (if in doubt, just add your name and add something to the end like "Deli" or "Pizza Shack" or "Food Cart" - note that it should be the kind of service that aligns with the food you want to serve... Example: // "Dr. Wilson's Trini Delights" b. 10 products that you'll have on your menu. Example: // 1) chicken roti, 2) doubles, 3) pelau, 4) aloo pie, 5) rum punch ... You can go over 10 if you want, but don't go nuts. 3. Set up your application. Page 1 of 4 a. Include the code to prompt the user for their name and then greet them by their name. You should know how to do this, but if you don't, here's the code. Don't copy it, as that may not work. Type it in. Then test until everything works nicely. I import java.util.*; 1 Scanner console = new Scanner (System.in); 1 System.out.print("What's your name? "); 1 String userName = aScanner.nextLine (); 1 String greeting = "Hey there, " + userName + "!"; b. Create a String and assign it to your company name (from before). c. Create another String and assign it to your name or nickname. d. Print out a welcome that concatenates these (i.e. "Welcome to Dr. Wilson's Trini Delights!") with good punctuation/formatting. Add your name to the prompt for the user's name, so you're saying, "I'm so-so-and-so. What's your name? ". e. Define a string called decorativeLine and assign it to a about 40 or more special characters (like #### f. Print the decorativeLine as the first thing and last thing in your main method. Put ###### or +++++++++++ or ***************).

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Part A: Setup your Business
1. Create a new Java file called ITSC1212Lab13.java:
a. Make sure you have a main method
2. Start by deciding the following and putting them into your file as comments:
a. The name of your food service (if in doubt, just add your name and add
something to the end like "Deli" or "Pizza Shack" or "Food Cart" - note that it
should be the kind of service that aligns with the food you want to serve...
Example: // "Dr. Wilson's Trini Delights"
b. 10 products that you'll have on your menu.
Example: // 1) chicken roti, 2) doubles, 3) pelau, 4) aloo pie, 5) rum punch ...
You can go over 10 if you want, but don't go nuts.
3. Set up your application.
Page 1 of 4
a. Include the code to prompt the user for their name and then greet them by their
name. You should know how to do this, but if you don't, here's the code. Don't
copy it, as that may not work. Type it in. Then test until everything works nicely.
I import java.util.*;
I Scanner console = new Scanner (System.in);
1 System.out.print ("What's your name? ");
I String userName = aScanner.nextLine () ;
1 String greeting
= "Hey there, " + userName + "!";
b. Create a String and assign it to your company name (from before).
c. Create another String and assign it to your name or nickname.
d. Print out a welcome that concatenates these (i.e. "Welcome to Dr. Wilson's Trini
Delights!") with good punctuation/formatting. Add your name to the prompt for
the user's name, so you're saying, "I'm so-so-and-so. What's your
name? ".
e. Define a string called decorativeLine and assign it to a about 40 or more special
characters (like #####
f. Print the decorativeLine as the first thing and last thing in your main method. Put
####### or +++++++++++ or**************).
a line break (In) after the first, and before the last so it'll be around your app
without being too close. Test and fix if necessary. Your program should look
something like (but feel free to change the verbiage, characters, etc... so long as
your input are clean and punctuated):
&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&
Welcome to Dr. Wilson's Trini Delights!
I'm Dr. Wilson. What's your name? Icabad
Hey there, Icabad!
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&
g. Show your work to a TA to receive credit for this section.
Part B: Create an Array to Display Menu - basic array traversal
1. Convert the line where you greet the user into a message that addresses them by
name and asks them to have a look at your menu. (i.e. "Here's what we serve, Felecia.
Have a look:").
2. Create an array with your menu. Put each of your menu items into a String array:
Transcribed Image Text:Part A: Setup your Business 1. Create a new Java file called ITSC1212Lab13.java: a. Make sure you have a main method 2. Start by deciding the following and putting them into your file as comments: a. The name of your food service (if in doubt, just add your name and add something to the end like "Deli" or "Pizza Shack" or "Food Cart" - note that it should be the kind of service that aligns with the food you want to serve... Example: // "Dr. Wilson's Trini Delights" b. 10 products that you'll have on your menu. Example: // 1) chicken roti, 2) doubles, 3) pelau, 4) aloo pie, 5) rum punch ... You can go over 10 if you want, but don't go nuts. 3. Set up your application. Page 1 of 4 a. Include the code to prompt the user for their name and then greet them by their name. You should know how to do this, but if you don't, here's the code. Don't copy it, as that may not work. Type it in. Then test until everything works nicely. I import java.util.*; I Scanner console = new Scanner (System.in); 1 System.out.print ("What's your name? "); I String userName = aScanner.nextLine () ; 1 String greeting = "Hey there, " + userName + "!"; b. Create a String and assign it to your company name (from before). c. Create another String and assign it to your name or nickname. d. Print out a welcome that concatenates these (i.e. "Welcome to Dr. Wilson's Trini Delights!") with good punctuation/formatting. Add your name to the prompt for the user's name, so you're saying, "I'm so-so-and-so. What's your name? ". e. Define a string called decorativeLine and assign it to a about 40 or more special characters (like ##### f. Print the decorativeLine as the first thing and last thing in your main method. Put ####### or +++++++++++ or**************). a line break (In) after the first, and before the last so it'll be around your app without being too close. Test and fix if necessary. Your program should look something like (but feel free to change the verbiage, characters, etc... so long as your input are clean and punctuated): &&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&& Welcome to Dr. Wilson's Trini Delights! I'm Dr. Wilson. What's your name? Icabad Hey there, Icabad! &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&& g. Show your work to a TA to receive credit for this section. Part B: Create an Array to Display Menu - basic array traversal 1. Convert the line where you greet the user into a message that addresses them by name and asks them to have a look at your menu. (i.e. "Here's what we serve, Felecia. Have a look:"). 2. Create an array with your menu. Put each of your menu items into a String array:
a. String] menultems = new String{"chicken roti", "doubles", "pelau". }; // based on
the products you listed above
b. Your array should have at least 10 items, but it's OK to have more.
c. Loop thru your array with a standard for loop and display the items, pay attention
to the number before each item, don't start with zero.
A simple loop that goes up thru an array:
for(int counter = 0; counter < arrayName.length; counter++)
{
System.out.printin((counter + 1) + arrayName[counter]);
}
h. Your application should now welcome the user, introduce you, get their name,
and introduce them by name to the menu, and then display the menu with a
proper heading. Run and test the program. Once you are satisfied, show your
work to a TA to receive credit for this section
Part C: Create an Array to Hold Order - traversal and populate array
1. Now you need to get the customer order. You need to find out how many items they
want to order, and then create an array with that many values. A limitation of arrays is
that you have to know how many items are in an array in order to create it.
a. Prompt the user for the number of items they'd like (i.e. How many things are you
ordering today)
b. Convert that number to an integer (Integer.parselnt()) and assign it to a new int
variable. (i.e. int numberofItems = Integer.parseInt (userInput);)
c. Create a new array to hold their order, using the number they put in.
String[] orderedItems = new String [numberofItems]
2. At this point you need to ask the user for each item they want based on the number of
items they plan to order e.g. "What's item #" where # is the count of the loop thru the
orderedltems array: i.e. "What's item 1?" The user will enter an integer that
corresponds with a menu item number.
Psuedocode:
// loop thru the orderedltems - once for each item
Il ask the user what they want by number
// take the user's entry and convert it to an integer
// hint: int number = Integer.parseInt (numberTheyGaveAsAString);
I/ use that integer to reference the item from the menuList, and assign it to that position
in the orderedltems list (i.e. orderedItems [counter] = menuList[number-1]; )
3. Once you've looped thru and collected the order, you can thank the user, and then tell
them what they are ordering (i.e. "You have ordered"); confirm their order by looping
Page 3 of 4
thru the orderedltems just as you did with the menu - only this time use a foreach loop:
for (String item: orderedItems)
{
System.out.println (item) ;
}
4. Thank the user by name, tell them something about how their order is coming right up,
and to have a great day.
5. Once you are satisfied, show your work to a TA to receive credit for this section
Bonus (1 point): Validate user input i.e. food selection must be within menu item's array
Bonus, Bonus (1 point): Add another array that is the same size as your menu array.
This array will hold the prices of each menu item. Calculate the total bill for their order.
Transcribed Image Text:a. String] menultems = new String{"chicken roti", "doubles", "pelau". }; // based on the products you listed above b. Your array should have at least 10 items, but it's OK to have more. c. Loop thru your array with a standard for loop and display the items, pay attention to the number before each item, don't start with zero. A simple loop that goes up thru an array: for(int counter = 0; counter < arrayName.length; counter++) { System.out.printin((counter + 1) + arrayName[counter]); } h. Your application should now welcome the user, introduce you, get their name, and introduce them by name to the menu, and then display the menu with a proper heading. Run and test the program. Once you are satisfied, show your work to a TA to receive credit for this section Part C: Create an Array to Hold Order - traversal and populate array 1. Now you need to get the customer order. You need to find out how many items they want to order, and then create an array with that many values. A limitation of arrays is that you have to know how many items are in an array in order to create it. a. Prompt the user for the number of items they'd like (i.e. How many things are you ordering today) b. Convert that number to an integer (Integer.parselnt()) and assign it to a new int variable. (i.e. int numberofItems = Integer.parseInt (userInput);) c. Create a new array to hold their order, using the number they put in. String[] orderedItems = new String [numberofItems] 2. At this point you need to ask the user for each item they want based on the number of items they plan to order e.g. "What's item #" where # is the count of the loop thru the orderedltems array: i.e. "What's item 1?" The user will enter an integer that corresponds with a menu item number. Psuedocode: // loop thru the orderedltems - once for each item Il ask the user what they want by number // take the user's entry and convert it to an integer // hint: int number = Integer.parseInt (numberTheyGaveAsAString); I/ use that integer to reference the item from the menuList, and assign it to that position in the orderedltems list (i.e. orderedItems [counter] = menuList[number-1]; ) 3. Once you've looped thru and collected the order, you can thank the user, and then tell them what they are ordering (i.e. "You have ordered"); confirm their order by looping Page 3 of 4 thru the orderedltems just as you did with the menu - only this time use a foreach loop: for (String item: orderedItems) { System.out.println (item) ; } 4. Thank the user by name, tell them something about how their order is coming right up, and to have a great day. 5. Once you are satisfied, show your work to a TA to receive credit for this section Bonus (1 point): Validate user input i.e. food selection must be within menu item's array Bonus, Bonus (1 point): Add another array that is the same size as your menu array. This array will hold the prices of each menu item. Calculate the total bill for their order.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY