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
The advancement in speed of transportation is attributed to invention of this device
morpeh [17]
The automobile is the invention
3 0
3 years ago
Please help I need help with web technology I forgot to post the question in the last one. here it is tho.
Vitek1552 [10]

Answer:

basically search tag <img>

Explanation:

<img src="image.gif" alt="MyImage">

3 0
2 years ago
Write a test program that creates two Rectangle objects—one with width 4 and height 40 and the other with width 3.5 and height 3
BARSIC [14]

Answer:

public class Rectangle {

   private double width;

   private double heigth;

   public Rectangle(double width, double heigth) {

       this.width = width;

       this.heigth = heigth;

   }

   public double getWidth() {

       return width;

   }

   public void setWidth(double width) {

       this.width = width;

   }

   public double getHeigth() {

       return heigth;

   }

   public void setHeigth(double heigth) {

       this.heigth = heigth;

   }

   public double perimeter(double width, double heigth){

       double peri = 2*(width+heigth);

       return peri;

   }

   public double area(double width, double heigth){

       double area = width*heigth;

       return  area;

   }

}

class RectangleTest{

   public static void main(String[] args) {

       //Creating two Rectangle objects

       Rectangle rectangle1 = new Rectangle(4,40);

       Rectangle rectangle2 = new Rectangle(3.5, 35.7);

       //Calling methods on the first Rectangel objects

       System.out.println("The Height of Rectangle 1 is: "+rectangle1.getHeigth());

       System.out.println("The Width of Rectangle 1 is: "+rectangle1.getWidth());

       System.out.println("The Perimeter of Rectangle 1 is: "+rectangle1.perimeter(4,40));

       System.out.println("The Area of Rectangle 1 is: "+rectangle1.area(4,40));

       // Second Rectangle object

       System.out.println("The Height of Rectangle 2 is: "+rectangle2.getHeigth());

       System.out.println("The Width of Rectangle 2 is: "+rectangle2.getWidth());

       System.out.println("The Perimeter of Rectangle 2 is: "+rectangle2.perimeter(4,40));

       System.out.println("The Area of Rectangle 2 is: "+rectangle2.area(4,40));

   }

}

Explanation:

  • Firstly A Rectangle class is created with two fields for width and heigth, a constructor and getters and setters the class also has methods for finding area and perimeters
  • Then a RectangleTest class containing a main method is created and two Rectangle objects are created (Follow teh comments in the code)
  • Methods to get height, width, area and perimeter are called on each rectangle object to print the appropriate value
5 0
2 years ago
What internal hardware device does a computer use to connect to a wired or a wireless network?
IrinaVladis [17]

Answer:

it will be ethernet and wireless network adapter

Explanation:because, wireless card is will able to connect to network wirelessly ,ethernet card will connect to network with ethernet cable RG45

if you give more info about your question will; try to help you better.

Thanks

8 0
3 years ago
When does technology become assistive technology?
deff fn [24]
Technology becomes assistive technology C. WHEN SOMEONE WITH A DISABILITY OR LIMITATION USES IT TO HELP HIM OR HER DO SOMETHING.

Assistive technology is defined as any technological item, equipment, software or product system that is used to assist individuals with disabilities to increase, improve, and maintain their functional capabilities.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Don is the superintendent of the county school system. What task might Don
    8·1 answer
  • Finding information on the web was made easier by _____________, which provide on-screen menus, making navigation of the web as
    12·1 answer
  • Anusha wants to use her computer,rather than handwriting the information on her notepad,to analyze her monthly expenses to make
    14·1 answer
  • Wireless data networks are particularly susceptible to known ciphertext attacks.
    10·1 answer
  • as the new hr manager hired by a company to clean up some of the company's problems,analyse the system requirements for the comp
    14·1 answer
  • If you have 128 oranges all the same size, color, and weight except one orange is heavier than the rest. Write down a C++ Code/A
    7·1 answer
  • It is a minor cereal of importance only in West Africa where it is eaten in place of rice during during famines. Used for salads
    10·1 answer
  • Fill in the word to complete the sentence.
    10·1 answer
  • How do I cancel and end my brainy subscription?
    11·2 answers
  • Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!