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 )
Answers
Answer 1
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();
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; } }
Related Questions
What are some ways that a sequence can go wrong? How could you solve any communication issues? Do you think this can happen with a computer program?