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]
3 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]3 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
In Java please.
Marizza181 [45]

Answer:

See explaination

Explanation:

public class YearToAnimal {

static void yearToAnimalZodiac(int year){

String[] animals = {"Rat", "Ox", "Tiger", "Rabbit", "Dragon", "Snake", "Horse", "Goat", "Monkey", "Rooster", "Dog", "Pig"};

int baseYear = 2020;

int index = (year - baseYear) % 12;

// in case of negative index, change it to positive

if(index < 0)

index = 12 + index;

System.out.println(year + ": " + animals[index]);

}

// some test cases

public static void main(String[] args) {

yearToAnimalZodiac(2020);

yearToAnimalZodiac(2021);

yearToAnimalZodiac(2019);

yearToAnimalZodiac(2009);

yearToAnimalZodiac(2008);

yearToAnimalZodiac(2007);

}

}

7 0
3 years ago
Marco travels often and does not have consistent wireless Internet service. He frequently uses his mobile phone service to provi
bulgar [2K]

Answer:

PAN

Explanation:

6 0
3 years ago
Read 2 more answers
A network administrator is designing a new network infrastructure that includes both wired and wireless connectivity. Under whic
Ganezh [65]

Wireless connectivity is recommended for use with laptops or mobile devices, especially as newer devices are less likely to have ethernet connectivity built in. In either case, use of wireless technology make it easier for users to move around without having to worry about being plugged in. Wired connections are still recommended for anything that doesn't need to be able to move as it is generally more reliable, and depending on the devices involved, could offer a faster connection.

7 0
3 years ago
Program kalkulator menggunakan bahasa pascal dan pake dua statemen
Hunter-Best [27]
What language is this???  Could you ask in English?
4 0
3 years ago
In which tear was computer aided drafing invented
babymother [125]

Answer:

1957

Explanation:

4 0
4 years ago
Other questions:
  • Which of these is a consistent periodic pulse separated into equivalent intervals of time?
    14·2 answers
  • Crystal detected a problem in a computer network, due to which she could not send or receive data within the network. She pings
    5·2 answers
  • Unlocking your smart phone remote security protections that protect your mobile device from meniscus applications
    5·1 answer
  • What layer uses the UDP protocol
    6·1 answer
  • Assignment 3: Chatbot
    11·2 answers
  • How do u know when a website doesnt like u?
    11·1 answer
  • A Color class has three public, integer-returning accessor methods: getRed, getGreen, and getBlue, and three protected, void-ret
    14·1 answer
  • Microsoft presentation software tool is called
    10·2 answers
  • A typical day in programming and software development would involve
    7·1 answer
  • Which of the following is not a valid Java identifier? a. Factorial, b. anExtremelyLongldentifierlfYouAskMe, c. 2ndLevel, d. Iev
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!