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
DochEvi [55]
3 years ago
7

OCR Land is a theme park aimed at children and adults. Entrance tickets are sold online. An adult ticket to OCR Land costs £19.9

9, with a child ticket costing £8.99. A booking fee of £2.50 is added to all orders. One ride in OCR Land has a minimum height of 140 cm to ride alone or 120 cm to ride with an adult. Create an algorithm that: • asks the user to input the height of the rider, in centimetres • if needed, asks if they are riding with an adult • outputs whether or not they are allowed to ride • repeats this process until 8 people have been allowed to ride
Computers and Technology
1 answer:
sladkih [1.3K]3 years ago
5 0

Answer:

count = 0

while count != 8:

   height = float(input("Enter height of the rider: "))

   if height >= 140:

       print("You are allowed to ride")

       count += 1

   else:

       if height >= 120:

           answer = input("Is the rider with an adult (yes/no): ")

           if answer == "yes":

               print("You are allowed to ride")

               count += 1

           else:

               print("You are not allowed to ride")

       else:

           print("You are not allowed to ride")

Explanation:

Initialize the count as 0, it will count the number of people allowed to ride

Create a while loop that iterates while count is not equal to 8

Inside the loop, ask the user for the height. If the height is greater than or equal to 140, print "You are allowed to ride" and increment the count by 1. Otherwise, check if the height is greater than or equal to 120. If it is not, print "You are not allowed to ride". If it is, ask if the rider is with an adult or not. If it is not, print "You are not allowed to ride". If it is print "You are allowed to ride" and increment the count by 1.

You might be interested in
Without using any additional variables, and without changing the values of ndays or the elements of the parkingTickets array, wr
dusya [7]

Answer:

Explanation:

mostTickets=0;

for (k=0; k< ndays; k++){

if (parkingTickets[k]>mostTickets) mostTickets=parkingTickets[k];

}

7 0
3 years ago
What is an indication that malicious code is running?
tatyana61 [14]

Answer:

If you are running Windows check task manager and see if any background process if running if there is a background process of command prompt or powershell, there is a chance that there is a backdoor running in your system, you can just right click and end the task it should just kick the hacker off the server.

please give brainliest

7 0
3 years ago
In this assessment, you will design and code a Java console application that validates the data entry of a course code (like IT4
ivolga24 [154]

Answer:

The program is written using jCreator IDE

Comments are used for explanatory purpose

Program starts here

import java.util.*;

public class courecode

{

public static void main(String [] args)

{

 String ccode; // Declare course code as string

 Scanner input = new Scanner(System.in);

 System.out.print("Course code: "); // Prompt user for input

 ccode = input.nextLine();

 boolean flag = true; // Initialize a boolean variable to true

 if(ccode.length() != 6) // Check if length of course code is 6

 {

  System.out.print("Input length must be 6"); //Display message if length of input string is not 6

 }

 else // If length is 6

 {

  for(int i = 0; i<6;i++) //check validity if input string using for loop

  {

   if(i == 0) //Test for first character

   {

    //The following if statement will be executed if the first character is not i or I

    if(ccode.charAt(i) != 'i' && ccode.charAt(i) != 'I')

    {

     System.out.println("Invalid Course Code");

     System.out.println("The course code must start with an i or I");

     flag = false; //Set boolean variable to false

     break;

    }

   }

   else if(i == 1)

   {

    //The following if statement will be executed if the second character is not t or T

    if(ccode.charAt(i) != 't' && ccode.charAt(i) != 'T')

    {

     System.out.println("Invalid Course Code");

     System.out.print("The second letter of the course code must be t or T");

     flag = false; //Set boolean variable to false

     break;

    }

   }

   else

   {

    //The following if statement will be executed if any of the last 4 characters is not an integer

    if(!Character.isDigit(ccode.charAt(i)))

    {

     System.out.println("Invalid Course Code");

     System.out.print("The last 4 characters of the course code must be an integer");

     flag = false; //Set boolean variable to false

     break;

    }

   }

  }  

 }

 //The following statment checks if boolean variable flag is still true

 // If true, then the input course code is valid and the accompanying print statement will be executed

 if(flag)

 {

  System.out.print("The input course code is valid");

 }  

}  

}

Explanation:

Lines marked with // are comments

Check comments (//) for explanation

4 0
3 years ago
The smaller RAM a computer has, the more software you can have open without impacting the speed of your computer
dsp73
False, forsure mates but gotta love the question:)
4 0
3 years ago
Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and
Montano1993 [528]

Answer:

1/2000

Explanation:

import java.util.Scanner;

public class InputExample {

public static void main(String [] args) {

Scanner scnr = new Scanner(System.in);

System.out.print("Enter birth month and date:");//comment this line if not needed

int birthMonth=scnr.nextInt();

int birthYear=scnr.nextInt();

String output= birthMonth+"/"+birthYear+"\n";

System.out.println(output);

}

}

if using this code the out put should be 1/2000

5 0
3 years ago
Other questions:
  • Sam has been asked to classify a number of different processing systems that his consultancy's client uses.
    9·1 answer
  • What is a service-oriented architecture? Group of answer choices A business-driven enterprise architecture that supports integra
    13·1 answer
  • One or more access points positioned on a ceiling, wall, or other strategic spot in a public place to provide maximum wireless c
    9·1 answer
  • Describa las características más importantes de cada procedimiento,difencias entre si Procedimiento Bessemer Procedimiento Sieme
    15·1 answer
  • A 9-year old male castrated Westie presents on emergency after being rescued from a house fire. On presentation, the dog has a r
    9·1 answer
  • The process of converting an input file (stream of characters) into an understandable format is called syntax analysis.
    7·1 answer
  • Which computer can perform the single dedicated task? a. Which commuter can perform the function of both analog and digital devi
    6·1 answer
  • Hello can you please help with this if you want to thank you!
    15·2 answers
  • How to change my age on this app
    10·2 answers
  • A/an _____________ is a stored program that executes at a specified time. Group of answer choices stored procedure view trigger
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!