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
Andru [333]
3 years ago
11

Consider a Games Expo for Children. Six competitions are laid out for the expo. Tickets are sold according to the age and gender

. The ticketing module of the Game Expo system is to be tested. According to the scenario, we got six scenarios based on the age and the competitions
1. Boys age > and <10, can participate in Storytelling.
2. Girls age >7 and <10, can participate in Drawing.
3. Boys age >11 and <15, can participate in a Quiz.
4. Girls age >10 and <15, can participate in Essay Writing.
5. Boys and girls age<6, can participate in Rhyming.
6. Girls and boys age >20, can participate in Poetry.
Computers and Technology
1 answer:
AysviL [449]3 years ago
3 0

Answer:

The program to this question can be defined as follows:

Program:

import java.util.*;  //import package for user-input

public class GamesExpo //defining GamesExpo class

{    

public static void main(String ag[]) //defining main method

{              

int age,gender; //defining integer variable

System.out.println("Welcome to Games Expo: ");   //print message

System.out.println("Enter age to get your type of games: ");//print message  

Scanner ob2=new Scanner(System.in); //creating scanner class object

age= ob2.nextInt(); // input value in age variable

System.out.println("Enter Gender, 1 for boy, 0 for girl"); //print message  

gender= ob2.nextInt(); // input value in gender variable

//defining conditional statement and print value according to user input  

if(gender==0) //if gender assign a value that is 0.

{

if(age>7 && age<10) //check age is in between 7 to 10  

{

System.out.println("Drawing");  //print message

}

else if(age>10 && age<15) //check age is in between 10 to 15

{

System.out.println("Essay Writing");  //print message

}

else if(age>20) //check age is greater 20

{

System.out.println("Poetry");  //print message

}

else // else block

{

System.out.println("Rhyming"); //print message

}

}

else if(gender==1) ///check gender value is equal to 1

{

if(age>7 && age<10) //check age is in between 7 to 10

{

System.out.println("Storytelling");  //print message

}

else if(age>11 && age<15) //check age is in between 11 to 15

{

System.out.println("Quiz");  //print message

}

else if(age>20) //check age is greater 20

{

System.out.println("Poetry");  //print message

}

else //else block

{

System.out.println("Rhyming");//print message

}

}

else //else block

{

System.out.println("Wrong choices");    //print message

}

}  

}

Output:

Welcome to Games Expo:  

Enter age to get your type of games:  

12

Enter Gender, 1 for boy, 0 for girl

1

Quiz

Explanation:

In the above program, first import the package for user input then defines the two integer variable "age and gender", in which we take input from the user end, by creating scanner class object, in the next line, the conditional statement is defined, that first checks the input value and print its value according to the condition.  In this program, there are multiple condition statement is used so, these conditions can be explained by the given output:

  • In the code execution time, first, it will input age, according to the age value, it will find the game in the given condition, for example, user input age value, i.e. equal to "12".
  • In this age value, it will select two games, for boys, it will select "Quiz", and for the girl, it will select "Essay Writing".
  • Then it will input the value of the gender, 1 for boy and 0 for a girl. if user input 1 so it will print "quiz", otherwise it will print "Essay Writing".
You might be interested in
Choose the correct item. Check your answers in the text.<br>3​
RSB [31]

Answer:

You should do that

Explanation:

You didnt say anything

5 0
3 years ago
After a group sets a project schedule, members should be prepared to
spin [16.1K]
<span>make periodic adjustments on an as-needed basis.  </span>
5 0
3 years ago
Read 2 more answers
Choose the word that best completes this sentence. You should post safe load _________ for each floor and keep aisles and passag
erica [24]
You should post safe load limits for
3 0
2 years ago
Read 2 more answers
Jabari created new video game for his coding course. What is one way he should format his pseudocode?
AleksAgata [21]

Answer:

Last one is the only logical one.

Explanation:

Hope this helps!!!

8 0
3 years ago
Database developers use the ________ to create relationships in the database.
madreJ [45]
Is it multiple choice ?<span />
7 0
3 years ago
Other questions:
  • How do you uninstall a program using the Control Panel?
    10·1 answer
  • What was the ENIAC computer and how was it used/what for?
    9·1 answer
  • A _____ attack floods a network or server with service requests to prevent legitimate users' access to the system. phishing back
    5·1 answer
  • Which of the following are documents that can help you to review and assess your organization’s status and state of security? Fi
    6·1 answer
  • Chuck plans to go on a hiking trip. Before the hiking trip, Chuck's bank account has $129.50. He then spends $129.50 on hiking g
    6·1 answer
  • What happens to a data table when the formulas or variables used to create it are changed?
    9·2 answers
  • 13) An-Excel-file-is-generally called-a-l-an:
    6·1 answer
  • What feature is available to add a auggestion in the margin of someone else's document.
    11·1 answer
  • Which of the following uses the proper syntax for creating an HTML comment?
    8·1 answer
  • Retype the below code. Fix the indentation as necessary to make the program work.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!