answer.
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
Nadya [2.5K]
1 year ago
5

The hostel in which you plan to spend the night tonight offers very interesting rates, as long as you do not arrive too late. Ho

usekeeping finishes preparing rooms by noon, and the sooner guests arrive after noon, the less they have to pay. You are trying to build a C program that calculates your price to pay based on your arrival time. Your program will read an integer (between 0 and 12) indicating the number of hours past noon of your arrival. For example, 0 indicates a noon arrival, 1 a 1pm arrival, 12 a midnight arrival, etc. The base price is 10 dollars, and 5 dollars are added for every hour after noon. Thankfully the total is capped at 53 dollars, so you'll never have to pay more than that. Your program should print the price (an integer) you have to pay, given the input arrival time.
Computers and Technology
1 answer:
faust18 [17]1 year ago
4 0

Answer:

Answered below

Explanation:

// Python implementation

incrementAmount = 5

basePrice = 10

price = 0

arrivalHour = int(input("Enter arrival hour 0-12: ")

if arrivalHour < 0 or arrivalHour > 12:

print ("Invalid hour")

if arrivalHour == 0:

price = basePrice

else:

price = arrivalHour * incrementAmount

totalPrice = price + basePrice

if totalPrice > 53:

totalPrice = 53

print ("Your bill is $totalPrice")

You might be interested in
You have been employed as a technical consultant to a computer shop chain. You are given the task of creating a short consumer b
brilliants [131]

Answer:

The five factors to consider when trying to choose between a Solid State Drive, a Hard Disk Drive and, an External Hard Disk Drive are:

  1. Read/Write Speed
  2. Weight
  3. Power Consumption
  4. Cost
  5. Storage Capacity

  • Solid State Drives (SSDs) are typically lighter in weight, faster and do not consume much power.
  • Hard Disk Drives are relatively cheaper than SSDs. They also come with higher storage capacities but are more power-hungry and slower because they rely on mechanical/moving parts to read and write data.
  • External HDDs are the cheapest of the three. They are not internal which is a major drawback given the additional weight. However, they come with gargantuan storage capacities that make you want to rethink having one. Besides, unlike SSDs, you can easily get them in computer accessories shops offline or online.

Cheers!

3 0
2 years ago
CodeLab Question
castortr0y [4]

Answer:

Idk the language of code but here is how it would be done in python

myAlarm():

   arm = True

   code = "secret message"

myAlarm()

main():

deactivate = input(">>> ")

if deactivate = myAlarm.code:

  arm = False

Im still a little confused on the question.

(I am a game designer and I code daily)

3 0
1 year ago
Write code that uses the input string stream inss to read input data from string userinput, and updates variables usermonth, use
mr Goodwill [35]

Answer:

It will be a java code.

Explanation:

import java.util.Scanner;

public class StringInputStream {

    public static void main (String [] args) {

        Scanner inSS = null;

        String userInput = "Jan 12 1992";

        inSS = new Scanner(userInput);`

        String userMonth = "";

        int userDate = 0;

        int userYear = 0;

        /* Your solution goes here  */

        System.out.println("Month: " + userMonth);

        System.out.println("Date: " + userDate);

        System.out.println("Year: " + userYear);

        return;

   }

}

3 0
2 years ago
Read 2 more answers
Which of the following code is correct? I: print("Programming is fun") print("Python") print("Computer Science") II: print("Prog
vfiekz [6]

Answer:

None of the options is correct.

Explanation:

One of the simplest statements that you can write in Python is a print statement, which causes a message to be displayed on the screen. For example, the following statement causes the message Python programming is fun! to be displayed:

print 'Python programming is fun!'

Notice that after the word print, the Python programming is fun! was written inside a set of single-quote marks. The quote marks are necessary, but they will not be displayed. They simply mark the beginning and the end of the text that we wish to display.

Here is an example of how you would type this print statement at the interpreter’s

prompt:

>>> print 'Python programming is fun!'

After typing the statement you press the Enter key and the Python interpreter executes the statement, as shown here:

>>> print 'Python programming is fun!'

Python programming is fun!

>>>

Thus, the correct way to write the codes in the question is:

print 'Programming is fun'

print 'Python'

print 'Computer Science'

3 0
2 years ago
Sarah maintains a blog about her soap-making business, and she has hired someone to create a database for this business. She mak
ivann1987 [24]
The database planner would most likely create a table that contains customer contact information since these would be the individuals who placed an order for Sarah's products after visiting her blog. 
4 0
1 year ago
Other questions:
  • U.S. industries like steel, computers, and energy need to be protected from foreign competition to ensure which of the following
    6·2 answers
  • When preparing a spreadsheet that contains population data for different nations, what is the best way to provide a visual compa
    12·2 answers
  • When creating a table in the relational database design from an entity in the extended e-r model, the attributes of the entity b
    13·1 answer
  • Which of these words could byte pair encoding compress the most?
    13·1 answer
  • Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a n
    7·2 answers
  • There is a file "IT4983" in my home (personal) directory. I don’t know my current working directory. How can I find out the file
    11·1 answer
  • What do you call the two parts of lift that go down a mine
    13·2 answers
  • The given SQL creates a Movie table with an auto-incrementing ID column. Write a single INSERT statement immediately after the C
    12·1 answer
  • Import simplegui
    10·1 answer
  • In a particular field, there are trees in a l single row from left to right. Each tree has a value V You cut trees from left to
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!