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
Alchen [17]
2 years ago
8

The visitor's age is stored in the variable age, the day of the week is stored in a variable day, and the price in dollars is st

ored in the variable price. Which piece of code will correctly decide the price for each ticket.
Computers and Technology
1 answer:
Hoochie [10]2 years ago
4 0

Answer:

If a museum charges different prices based on the day of the week and age of the visitor. The pricing rules are shown below.

- On Tuesday and Thursday children 10 and under get in free ($ 0).

- For all other days and ages the cost is ten dollars ($ 10).

The code in python is;

if (day == 'Tuesday' or day == 'Thursday') and age <= 10:

   price = 0

else:

   price = 10

Explanation:

The logic of the algorithm suggests that that the conditional if-statement assigns zero to the price variable if the day variable is either Tuesday or Thursday and the child's age is 10 or below but assigns 10 to the price variable if the condition is not met.

You might be interested in
1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a s
masya89 [10]

Answer:

import java.util.Scanner;

public class TestClock {

   public static void main(String[] args) {

 Scanner in = new Scanner (System.in);

       System.out.print("Enter favorite color:");

 String word1 = in.next();

       System.out.print("Enter pet's name:");

 String word2 = in.next();

       System.out.print("Enter a number:");

 int num = in.nextInt();

       System.out.println("you entered: "+word1+" "+word2+" "+num);

   }

}

Explanation:

Using Java Programming language

  1. Import the Scanner class
  2. create an object of the scanner class
  3. Prompt user to enter the values for the variables (word1, word2, num)
  4. Use String concatenation in System.out.println to display the output as required by the question.

7 0
2 years ago
Why do arthitects prefer memory dump to be in base 16​
gogolik [260]

Answer:

Memory dump in  base 16​ is human friendly

Explanation:

Hexadecimal numbers are human friendly and hence it is very easy to express the binary number in a more human-friendly as compared to any other base number systems. It is also used to trace errors in the storage

hence, the Architects prefer memory dump to be in base 16​

7 0
2 years ago
How do u set up a Wi-Fi network on Android ​
AlladinOne [14]

Answer:

These are some way I know

5 0
2 years ago
Which of the following are possible ways to
Andru [333]

Answer:

employ ability assessments and the ability to perform tasks

Explanation:

6 0
2 years ago
Read 2 more answers
Write a C program to prform simple C aritlimetic calculations. The user is to enter a simple expression(integer operaior integer
larisa86 [58]

Answer:

Here is the C program:

#include <stdio.h>  //to use input output functions

//functions prototype

unsigned int mod(unsigned int a, unsigned int b);  

unsigned int mul(unsigned int a, unsigned int b);  

unsigned int sub( unsigned int a,unsigned int b);

float divide(unsigned int a,unsigned int b);  

unsigned int add( unsigned int a,unsigned int b);  

int main()  {  //start of main method

unsigned int a, b;   //declare variables to store the operands

char d;  //declare variable to store the operator

printf("Enter an operator:  ");   //prompts user to enter an operator

scanf("%c",&d);  //reads the operator from use

getchar();  //gets a character

while (d!='q')   { //keeps iterating until user enters q to quit

printf("Enter 1st operand: ");   //prompts user to enter first operand

scanf("%d",&a);   //reads first operand from user

getchar();  //reads character

printf("Enter 2nd operand: ");   //prompts user to enter second operand

scanf("%d",&b);   //reads second operand from user

getchar();  

if (d=='%')  {   //if the character of operator is a mod

printf("%d",a);  //prints operand 1

putchar(d);  //displays operator

printf("%d",b);  //displays operand 2

printf(" = ");  //displays =

mod(a,b);  }  //displays computed modulo of two input operands

if (d=='*')   //if the input character is for multiplication operator

{printf("%d",a);  //prints operand 1

putchar(d);  //displays operator

printf("%d",b);  //displays operand 2

printf(" = ");  //displays =

mul(a,b); }  //displays computed multiplication

if (d=='+')  {  //if the input character is for addition operator

printf("%d",a);  //prints operand 1

putchar(d);  //displays operator

printf("%d",b);  //displays operand 2

printf(" = "); // displays =

add(a,b);  }   //displays computed addition

if (d=='/')  {  //if the input character is for division operator

printf("%d",a); // prints operand 1

putchar(d);  //displays operator

printf("%d",b);  //displays operand 2

printf(" = ");  //displays =

divide(a,b);  }   //displays computed division

if (d=='-')  {  //if the input character is for subtraction operator

printf("%d",a);  //prints operand 1

putchar(d);  //displays operator

printf("%d",b); // displays operand 2

printf(" = ");  //displays =

sub(a,b);  }  //displays computed subtraction

printf("Enter an operator: ");   //asks again to enter an operator

scanf("%c",&d);  //reads operator from user

getchar();  }  }   //gets character

unsigned int mod( unsigned int a, unsigned int b){  //function to compute modulo of two integers with no sign

     int c = a%b;  //computes mod

    printf("%d",c);  }  //displays mod result

unsigned int add(unsigned int a, unsigned int b){     // function to compute addition of two integers

    int c = a+b; //computes addition

    printf("%d\n",c);  } //displays result of addition

unsigned int mul(unsigned int a, unsigned int b){       //function to compute multiplication of two integers

    int c = a*b;  //multiplies two integers

   printf("%d\n",c); }  //displays result of multiplication

float divide(unsigned int a, unsigned int b){   //function to compute division of two integers

    float c = a/b;  //divides two integers and stores result in floating point variable c

    printf("%f\n",c);  } //displays result of division

unsigned int sub(unsigned int a, unsigned int b){       //function to compute subtraction of two integers

    int c = a-b;  //subtracts two integers

    printf("%d\n",c);  }  //displays result of subtraction

Explanation:

The program is well explained in the comments mentioned with each line of the program. The program uses while loop that keeps asking user to select an operator and two operands to perform arithmetic calculations. The if conditions are used to check what arithmetic calculation is to be performed based on user choice of operand and calls the relevant function to perform calculation. There are five functions that perform addition, modulo, subtraction, division and multiplication and display the result of computation. The screenshot of output is attached.

4 0
3 years ago
Other questions:
  • A paradigm innovation occurs when:
    6·1 answer
  • To help determine which technology to use, Raul creates a table to help him compare the pros and cons of his choices. What part
    15·1 answer
  • At the coffee shop where they work, Jen is the safety officer, Richard is in charge of administering first aid, Ashley is respon
    13·2 answers
  • https://brainly.com/app/ask?entry=top&amp;q=What+did+you+learn+during+this+course+that+reinforces+your+belief+in+your+technology
    5·1 answer
  • What operating system is an open source program
    15·1 answer
  • Banks use _____, which are electronic transmissions of account exchange information over private communications’ networks.
    14·1 answer
  • Which statement best describes desktop publishing?
    10·1 answer
  • Excel files have a default extension of ?
    12·1 answer
  • Who are the following furries?
    10·2 answers
  • What is the computer?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!