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
Nadya [2.5K]
2 years 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]2 years 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
Who's better Kapkan or Tachanka?
navik [9.2K]
If you want fun operator, get chanka, if you want good operator, get kapkan it also depends if depends you are a stationary man who likes big guns or a mobile man who likes traps
4 0
3 years ago
List five ways in which the type declaration system of a language such as Java or C differs from the data definition language us
zhannawk [14.2K]

Answer:

Hi Sevanah! Below are the five main differences between a type declarative language and a data definition language:

A data definition language:

1. define data structure

2. define the column attributes of a table

3. no further classifications

4. The basic commands in a Data Definition language are CREATE, DROP, RENAME, ALTER

5. Scope of variables in data definition languages is limited  

A type declarative language:

1. manipulate the data itself

2. uses functions to add and update the rows of a table

3. further classified into procedural and non-procedural languages

4. The basic commands are INSERT, UPDATE and MERGE

5. Scope of variables in type declarative languages is varied

Explanation:

A data definition language is used to define data structures. It makes use of statements such as create table, alter table to create and alter the database schema to allow it to hold rows of information. A type declarative language such as Java or C is used to manipulate the data itself. For example, insert, update and deletion of rows to the database. Whereas data definition languages define the column attributes of a table, a type declaration language uses functions to add and update the rows of a table. A data definition language does not have any further classification, however a type declarative language can be further classified into procedural and non-procedural languages. The basic commands in a Data Definition language are CREATE, DROP, RENAME, ALTER, whereas the basic commands in a type declarative language are INSERT, UPDATE and MERGE. There is little of no scope of variables in a data definition language, whereas the scope of variables in type declarative languages is varied

8 0
3 years ago
What processes can move a solute against its concentration gradient?
Rudiy27

Explanation:

To move substances against a concentration or electrochemical gradient, the cell must utilize energy in the form of ATP during active transport. Primary active transport, which is directly dependent on ATP, moves ions across a membrane and creates a difference in charge across that membrane.

7 0
3 years ago
Bill is pushing a box with 10 N of force to the left, while Alice is pushing the box with 30 N of force to the right. What is th
Greeley [361]

Answer:

Net force = 20 N

Explanation:

Given that,

Force acting on the left = 10 N

Force acting on the right = 30 N

Let right side is positive and left side is negative. Let the net force acting on the box is F. So,

F = -10+30

F = 20 N

So, the net force on the box is 20 N and it is in right side.

7 0
2 years ago
In the Database sheet, enter conditions in the criteria range for unoccupied two- and three-bedroom apartments that need to be r
kari74 [83]

Answer:

See attachment fir procedures to get answers.

Explanation:

Given that;

In the Database sheet, enter conditions in the criteria range for unoccupied two- and three-bedroom apartments that need to be remodeled. Enter criteria as text only, without use of quotation marks. Be sure to enter the criteria separately in rows 3 and 4.

See attachment

3 0
3 years ago
Other questions:
  • Days of the week are represented as three-letter strings ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"). Write a javaScript f
    14·1 answer
  • Summarize the five stages of cultural shock
    11·2 answers
  • Each row in a database is a set of unique information called a(n) (A.)table,(B.)record,(C.)object,(D.)field
    12·2 answers
  • Create a program that generates a report that displays a list of students, classes they are enrolled in and the professor who te
    11·1 answer
  • Based on a Supreme Court ruling, an Internet-based merchant needs to charge sales tax only when _____.
    9·1 answer
  • What is boolean rules​
    12·1 answer
  • Code Problem 3 in Python 2.
    5·1 answer
  • A(n) ___________________ is a set of characters that the originator of the data uses to encrypt the text and the recipient of th
    10·1 answer
  • Most case fans have standard _______________ connectors that are easy to plug in but can be forced to be connected the wrong way
    14·1 answer
  • What is the name for data generated by a computer using an algorithm?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!