1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
saul85 [17]
3 years ago
15

In this project, you will create a Java program that asks a customer at a clothing store for his waist measurement. Based on his

response, you will tell him his pant size is small, medium, or large. You will write this code twice, once using a switch-case statement and once using nested if statements.
( PLEASE HELP, THIS IS MAKING ACTUAL CODE THEY NEVER TAUGHT ME HOW TO CODE SO I DONT KNOW HOW TO, THE CODE DOESN'T NEED TO BE RIGHT IT JUST NEEDS TO LOOK LIKE IT )
Computers and Technology
2 answers:
kondaur [170]3 years ago
8 0

Answer:

ok glad you figured it out :)

ElenaW [278]3 years ago
4 0
Import java.util.Scanner;

public class WaistSize {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);

System.out.println("What is the measurement of your waist in inches?");
int waistSize = input.nextInt();

String sizeGuideA = sizeGuide1(waistSize);
String sizeGuideB = sizeGuide2(waistSize);

System.out.println("Nested If Statements return: " + sizeGuideA);
System.out.println("Switch-Case Statements return: " + sizeGuideB);

}
public static String sizeGuide1(int n) {
String size = "null";

if(n <= 25) {
return size = "Extra Small";
}

if(n > 25 && n <= 28) {
return size = "Small";
}

if(n > 28 && n <= 30) {
return size = "Medium";
}

if(n > 30 && n <= 32) {
return size = "Large";
}
else {
return "Error";
}
}

public static String sizeGuide2(int n) {
String size = "null";

switch(n) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
size = "Extra Small";
size = "Extra Small";
break;
case 26:
case 27:
case 28:
size = "Small";
break;
case 29:
case 30:
size = "Medium";
break;
case 31:
case 32:
size = "Large";
break;


}

return size;
}
}
You might be interested in
Why is Touchpad used in the laptop computer​
Ber [7]

Answer:

in controlling the mouse or cursor

Explanation:

as is it known tha a cursor is a poniting device. and the only way to control it without a mouse is the touchpad

3 0
4 years ago
Can Anybody Answer This For Me ?
AlladinOne [14]

Answer:

I'm pretty sure its 3 only (c) III only gimme brainliest

3 0
4 years ago
Which of the following may present a problem for Linux users?
motikmotik
Tendancy to crash hope that helped
6 0
4 years ago
Read 2 more answers
Using an API means that games take a performance hit, but are able to render more CPU intensive graphics.
Sergio [31]
Yes that is correct. Was there a specific question you wanted answered...
7 0
3 years ago
Read 2 more answers
Please help ASAP, will mark brainliest!
Nezavi [6.7K]

Answer: The answer would be B.

Explanation:

6 0
3 years ago
Other questions:
  • Write a program that asks for 'name' from the user and then asks for a number and stores the two in a dictionary (called 'the_di
    9·1 answer
  • Ferestre de navigare
    12·1 answer
  • Which type of movement lets the player control an object's movement?
    5·1 answer
  • The item that is clicked in a JList can be retrieved using the _____ method of JList.
    8·1 answer
  • Which layer enables the receving node to send an acknowledgement?
    11·1 answer
  • Which option is an example of a Boolean operator?<br> O A. HTML<br> O B. <br> C. SEO<br> D. NOT
    5·1 answer
  • Which element of a presentation program’s interface displays the slide you are currently creating or editing?
    14·2 answers
  • use the internet to research the SYSTEM account. Why is it nessesary to include this account with full control on a directory
    13·1 answer
  • 1. Would it be possible for two people to have the same email address? Explain.
    9·2 answers
  • What type of display allows the user to access a large amount of vocabulary in one device, uses spelling to convey the message,
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!