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
What is segmentation and paging?
iogann1982 [59]

Over the years, operating systems have sought to be more efficient, which is why it is vital that the use of main memory such as ram be as intelligent as possible, so that operating systems are more efficient.

Segmentation is a process of dividing the program into logical units, such as sub functions, arrays, variables, etc., making it possible to have processes divided into pieces so that it is easy to access each of the processes that this leads to its execution. Segmentation allows the programmer to contemplate the memory as if it had several address spaces or segments. References to memory consist of an address of the form segment number - offset.

Pagination is a technique where memory space is divided into physical sections of equal size, called page frames. The programs are divided into logical units, called pages, that are the same size as the page frames. In this way, an information page can be loaded in any page frame. The pages serve as an information storage unit and transfer between main memory and auxiliary or secondary memory. Each frame is identified by the frame address, which is in the physical position of the first word in the page frame.

8 0
3 years ago
Which of the following is not a valid SQL command? (Points : 2) UPDATE acctmanager SET amedate = SYSDATE WHERE amid = 'J500';
Volgvan

Answer:

UPDATE acctmanager WHERE amid = 'J500';

Explanation:

The statement written above is not valid SQL statement because there is no SET after UPDATE. Update is always used with SET.If you are updating something then you need to specify the value with which that value should be replaced.

UPDATE acctmanager SET amname = UPPER(amname);

This statement does not contains WHERE clause but it will run all the values of amname column will get updated in the table acctmanager.

6 0
2 years ago
"Write an iterative function iterPower(base, exp) that calculates the exponential baseexp by simply using successive multiplicat
sp2606 [1]

Answer:

I am writing the function using Python. Let me know if you want the program in some other programming language.            

def iterPower(base, exp):    

    baseexp = 1

    while exp > 0:

        baseexp = baseexp*base

        exp= exp - 1

    return baseexp

base = 3

exp = 2

print(iterPower(base, exp))

Explanation:

  • The function name is iterPower which takes two parameters base and exp. base variable here is the number which is being multiplied and this number is multiplied exponential times which is specified in exp variable.
  • baseexp is a variable that stores the result and then returns the result of successive multiplication.
  • while loop body keeps executing until the value of exp is greater than 0. So it will keep doing successive multiplication of the base, exp times until value of exp becomes 0.
  • The baseexp keeps storing the multiplication of the base and exp keeps decrements by 1 at each iteration until it becomes 0 which will break the loop and the result of successive multiplication stored in baseexp will be displayed in the output.
  • Here we gave the value of 3 to base and 2 to exp and then print(iterPower(base, exp)) statement calls the iterPower function which calculates the exponential of these given values.
  • Lets see how each iteration works:
  • 1st iteration

baseexp = 1

exp>0 True because exp=2 which is greater than 0

baseexp = baseexp*base

               = 1*3 = 3

So baseexp = 3

exp = exp - 1

      = 2 - 1 = 1    

exp = 1

  • 2nd iteration

baseexp = 3

exp>0 True because exp=1 which is greater than 0

baseexp = baseexp*base

               = 3*3 = 9

So baseexp = 9

exp = exp - 1

      = 1-1 = 0    

exp = 0

  • Here the loop will break now when it reaches third iteration because value of exp is 0 and the loop condition evaluates to false now.
  • return baseexp statement will return the value stored in baseexp which is 9
  • So the output of the above program is 9.
5 0
2 years ago
Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject afte
SCORPION-xisa [38]

Changing a worksheet name in Microsoft Excel can be done in multiple ways, but only one of them is correctly explained in the provided option, which is (A) double-click both the worksheet tabs one at a time and then enter the new names.

The other options are incorrect. Even though you can change a worksheet’s name by right-clicking the sheet name, you also need to choose the appropriate option from the window bar that would appear – which is, of course, the rename option.

5 0
3 years ago
Read 2 more answers
Troy, an aspiring screenwriter, aspires to work with a famous director known for his philanthropic work. Troy gets an appointmen
kicyunya [14]

Troy should include a short overview of the story that his video will tell and why he wants to tell it (or what the video will be about and why). It should also include the target audience, and where the video will be published.

7 0
3 years ago
Other questions:
  • Put the following five steps in the order in which you would perform them to use the Paste Special function: ____. 1. Select and
    5·1 answer
  • Write the UPDATE command to increase the commission (column name :COMM) by 500 of all the salesman who have achieved sales (Colu
    15·1 answer
  • An important task that the operating system performs is ____, which keeps track of the files stored on a computer so that they c
    15·1 answer
  • Which layer includes the physical transmission medium (cables or wireless media) that any network must use to send and receive t
    8·1 answer
  • What integer is represented by the following 8-bit twos complement representation: 1011 0000 ? (Enter your number in decimal, an
    6·1 answer
  • A(n) _____ is a firm that delivers a software application, or access to an application, by charging a usage or subscription fee.
    6·1 answer
  • What happens if the user sysadmin invokes the mail command interface and there are no unread mail messages?
    13·1 answer
  • What does the CFO of a company do
    14·1 answer
  • I want to sign up for brainly but it won't let me. It keeps saying "we can complete your registration at this time".
    13·1 answer
  • Counselors do NOT provide which service during treatment?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!