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();

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;
}
}

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?

Answers

Answer:

Yes, then often happens to me

Explanation:

Other Questions
A story needs to have two main characters; they are the _____. protagonist and antagonist round and static good vs. evil flat and dynamic Permanently frozen ground that thaws only briefly at the surface is known as ______. Question 14 options: Which term is used for the condition in which the body's internal temperature is too high?A. hypothermiaB. hyperthermiaC. hypoglycemiaD. hypothyroidism i need help answering this What was an unintended consequence of the Eighteenth Amendment? What are the similarities between micro teaching and peer teaching Whats the answer for this i cant figure it out. But T.J. did not follow immediately. He remained standing in the middle of the compound, his face puzzled and undecided. I had never seen him look more desolately alone, and for a fleeting second I felt almost sorry for him.Roll of Thunder, Hear My Cry,Mildred D. TaylorWhat is the authors tone toward T. J. in this passage?? angryX anxious? excited ? pitying XYZ stock price and dividend history are as follows: Year Beginning-of-year Price Dividend paid at Year-End 2010 $100 $4 2011 $110 $4 2012 $90 $4 2013 $95 $4 What is the arithmetic average rate of return for the period from the beginning of 2010 to the end of 2012 Find the measure of angle 1. a. 95b. 100d. 105 What is the value of 43 = 23? 2 7 8 16 Someone help right now :( Which statement best describes why conflict remained between Israelis and Palestinians following the Camp David Accords?Israelis stopped providing economic aid to the Palestinians.Palestinian leaders refused to meet with the Israeli government.The Palestinian Liberation Organization refused to recognize Israel as a nation.Israel forced members of the Palestinian Liberation Organization to leave the country. The vertex form of the equation of a parabola is y = 3(x-4)2 +13. What is thestandard form of the equation?A. y=x-X2 - 8x + 21c- 4x + 29B. y = 1x2 - 4C. y=1x2 - 4D. y-1x2 - Bx +294x +21W if the cell is not to divide, at which checkpoint will the cycle stop and move into a resting phase? if you help, ill give brainly!! This is another challenging questionnn yayy All over the world, animal habitats bump up against human development. Where these two worlds collide, animals almost never farewell. Highways, where humans speed by large tracts of natural habitat like missiles of doom, are especially dangerous for wild creatures. They can also be deadly, not just for individual animals but for entire species. The Florida panther, for example, has such a low population that each time one is killed on a highway, it is a catastrophic loss.There is hope, however, in a new way of helping animals cross through highway areas unharmed. Wildlife overpasses give animals a way to cross highways without risking their lives. These look and work like bridges but are usually covered with grass and trees that make animals like deer feel welcome. The cars drive through a tunnel under the bridges. Fences along the top edges keep the animals safe.These overpasses also connect habitats, so along with deer, the coyotes who hunt them can cross. This allows both species to have a larger range, which also helps their long-term survival. To the animals in these habitats, the overpasses may be like an extra safety net that helps them survive a drought. The bridges are especially important for animals that migrate. For centuries, animals like elk and buffalo migrated on trails that still, now, lead right up to the edges of major highways. With the help of these bridges, migrating animals can still follow their long-used paths unharmed.In some cases, these overpasses benefit humans directly as well. In these cases, the overpasses are part of green space or parks that people use for cycling, backpacking, or jogging. The overpasses give humans access to areas they may not have been able to see but also provide safety for animals.The next time you are traveling on a highway, keep a lookout for a wildlife passage. With attention to how our lives affect the natural world, we can find clever solutions, like wildlife passages, that help animals and improve our lives, too.Extra! Extra!Not all wildlife accommodations for highways are overpasses. In some cases, certain species are so important that underpasses or underground tunnels are built. In Florida, two such underpasses help turtles, snakes, and alligators that often migrate from one body of water to another. Since these creatures do not have much speed, crossing a highway for them is even more deadly than it is for swift animals like deer. Working as a large funnel, these underpasses usually require a barricade or fence alongside the highway that forces animals toward a tunnel. Aquatic turtles especially benefit from these tunnels as they lay eggs in holes dug in dry ground, away from the lake they live in.Read this sentence from the text: In some cases these overpasses benefit humans directly as well.What is the purpose of this line in the essay?(options are below) The writer wants to add a sentence after sentence to provide factual support for the introductory claim and focus the audience on the argument of the passage. Which of the following sentences best accomplishes thispurpose?AThanks to a process called neuroplasticity, the brain continually strengthens or weakens neural connections in response to stimull from smartphones.BResearchers at Columbia University argue that "wle are becoming symbiotic with our computer tools, growing into interconnected systems that remember less by knowing information than by knowingwhere the information can be found."According to a recent Gallup Poll, only 21 percent of Americans say they "rarely or "never" feel mental or emotional strain in their day-to-day lives.DA recent study found that 86 percent of Americans are stressed out from constantly checking their smartphonesNeuroscientist Susan Greenfield cautions that social media can become a platform for constructing an artificial identity to impress an audience of barely known "Friends" Munson Co. uses a job order cost system. The following data summarize the operations related to production for July: July 1 Materials purchased on account, $225,750 2 Materials requisitioned, $217,600, of which $17,600 was for general factory use 31 Factory labor used, $680,000, of which $72,300 was indirect. 31 Other costs incurred on account for factory overhead, $330,000; selling expenses, $180,000; and administrative expenses, $126,000 31 Prepaid expenses expired for factory overhead, $27,500; for selling expenses, $8,100; and for administrative expenses, $5,250 31 Depreciation of office building was $44,500; of office equipment, $16,800; and of factory equipment, $55,100 31 Factory overhead costs applied to jobs, $548,000 31 Jobs completed, $1,140,000 31 Cost of goods sold, $1,128,000Required:Journalize the entries to record the summarized operations. pls help asap!! The surface of earth has many impact craters that have been filled in with sediment. these craters were created byA. molesB. dinosaursC. peopleD. meteorites