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
Gold jewellery is made when solid-gold is melted and then put into containers which are the shape of the jewellery. After this t
Scilla [17]

Answer:

B

Explanation:

Self Explanatory - It is melted into a liquid then poured into a mold. It cools and becomes solid.

5 0
3 years ago
Pig Latin is a nonsense language. To create a word in pig Latin, you remove the first letter and then add the first letter and "
LUCKY_DIMON [66]

Answer:

Hi there  Sandrathompson5661!  

Using Java as the language for implementation, the PigLatin translation program can simply be coded as shown below. The program uses the Scanner module in java utils package to prompt the user for input of word(s) and splits the input with any of the matching delimiters. The rule to swap the first character and append it to the end with an “ay” for a normal word, or the appending of “yay” for a vowel word, is then applied. The result is printed on the screen before the program exits.

Explanation:

import java.util.Scanner;

public class PigLatin {    

 public static void main(String[] args)     {        

   char[] delimiterChars = { ' ', ',', '.', ':', ';', '\t' };        

   String[] words_array;        

   Scanner words = new Scanner(System.in);        

   System.out.println("Please enter a word (for multiple words use any of the following delimiters {' ', ',', '.', ':', ';', '\t' }): ");        

   String input_words = words.nextLine();        

   words_array = input_words.split("[,\\s\\-:.;' '\\\t]");  

   System.out.println("PigLatin translation: ");        

   for (int i=0; i<words_array.length; i++) {

     System.out.println(makePigLatin(words_array[i]));        

   }    

 }      

 public static String makePigLatin(String word)     {        

    String vowels = "aeiou";        

    if (vowels.indexOf(Character.toLowerCase(word.charAt(0))) != -1) {          

       word = word + "yay";        

    }        

    else {          

       word = word.substring(1, word.length()) + word.charAt(0) + "ay";        

    }        

    return word;      

 }

}

7 0
3 years ago
Write the definition of a function typing_speed, that receives two parameters. The first is the number of words that a person ha
m_a_m_a [10]

Answer:

The function code and the formula for the above question is listed below:

Explanation:

Function:

float typing_speed(int Number_of_words, int Time_in_seconds)

{

float time= Time_in_seconds/60;

float speed= Number_of_words/time;

return speed;

}

Formula for this algorithm or program:

Number of words per minute= number of words/ Time(in minutes).

Function Explanation

  • The above function defined in the c-language code, which is used to return the typing speed for any user when he enters the number of words and the time in seconds.
  • The speed is calculated with the help of the above-defined formula.
  • The first statement of the code is used to change the time in a minute.
  • The second statement of the code is used to calculate the speed by the help of speed formula.
  • Then the third statement returns the value of the speed variable.

6 0
3 years ago
Is www part of every url address?
melisa1 [442]
The correct answer is that WWW. is universal, meaning that any and all url addresses start and have www.

My reasoning is that if you were to look up, lets say google, do :

www.(google).com ( remove parentheses )

then

google.com 

You come up with the same results THUS YOUR CORRECT ANSWER IS YES! ALL URL ADDRESS HAVE AND CONTAIN WWW.!!!

5 0
4 years ago
When comparison shopping, all of these hint at a good deal EXCEPT_____________________.
noname [10]

Answer:

lower-priced models offer more features

Explanation:

3 0
3 years ago
Other questions:
  • What are the five steps of ethical hacking?
    15·1 answer
  • In the ADT graph, the method addEdge has efficiency
    6·1 answer
  • What is the size of the opening in the camera that the light passes through?
    9·2 answers
  • Which of the following will you select as X in the following series of clicks to lay the title over a chart: Chart Title box &gt
    14·1 answer
  • Why were american colonists unhappy with king george iii?
    6·2 answers
  • All of the following statements about logistics information systems (LIS) are true except ________.
    14·1 answer
  • Which of the following statements is true regarding Wireshark?
    11·1 answer
  • What software could i use to create music like Aphex Twin?
    6·1 answer
  • THE DIFFERENCE BETWEEN COPY AND PASTE AND CUT AND PASTE IS: *
    5·2 answers
  • The implementation stage of the SDLC is when the system is moved into operation where it can be used. What stage PRECEDES the im
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!