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
kykrilka [37]
4 years ago
14

There are six items to be rung up in the cash register. The first item costs $15.00. Each item after that costs an additional $2

.00. (item #2 costs $17, item #3 costs $19, etc.) Create Python program code using a for loop that will print the cost of each item, starting with the $15 item, and it will calculate and print the total cost. Your program should then use the sequence formula as an alternative way to calculate the total cost and print the result.
Engineering
1 answer:
Paha777 [63]4 years ago
4 0

Answer:

Explanation:

Below is the python code :

#using a for loop that will print the cost of each item

#first item cost is $15.0

item = [15.0]

tcost = 0.0

#for loop to print cost of each item and calculate total cost

for i in range(6):

tcost += item[i]

print('Cost of item ', (i+1), ' : $', item[i], sep = '')

item.append(item[i] + 2)

#print total cost

print('Total cost: $', tcost, sep = '')

print()

#Sequence formula to calculate the total cost

#total cost = n * ((first + last) / 2)

print('Calculating total cost using sequence formula')

tcost2 = 6 * ((15 + 25) / 2)

print('Total cost: $', tcost2, sep = ''

You might be interested in
What do you own that might not be manufactured?
horrorfan [7]

Answer:

A pet

Explanation:

Latin time I checked animals aren't made by people? I honestly don't know if this helps but I'm technically not wrong.

8 0
3 years ago
Question 1 : Replacement [42 Pts] Consider the following page reference string:
MakcuM [25]

Answer:

Optimal

Time 123456789101112

RS. ecbeagdcegda

F0. eeeeeeeee e e a

F1 c c c c c c c c c c c

F2 b b b g g g g g g g

F3 a a d d d d d d

Page fault? * * * * * * *

Total page fault:7

2. LRU

Time 1 2 3 4 5 6 7 8 9 10 11 12

RS e c b e a g d c e g d a

F0 e e e e e e e c c c c a

F1 c c c c g g g g g g g

F2 b b b b d d d d d d

F3 a a a a e e e e

Page fault? Y Y Y N Y Y Y Y Y N N Y Total page fault:9

3. LRU approximation algorithm: Second chance

Time 1 2 3 4 5 6 7 8 9 10 11 12

RS e c b e a g d c e g d a

F0 0,e 0,e 0,e 1,e 1,e 0,e 0,e 0,e 1,e 1,e 1,e 0,e

F1 0,c 0,c 0,c 0,c 0,g 0,g 0,g 0,g 1,g 1,g 0,g

F20,b0,b0,b0,b0,d0,d0,d0,d1,d0,dF30,a0,a0,a0,c0,c0,c0,c0,a

Page fault? YYYNYYYYNNNY

Total page fault: 8

4 0
3 years ago
Read 2 more answers
The permeability coefficient of a type of small gas molecule in a polymer is dependent on absolute temperature according to the
jok3333 [9.3K]

Answer:

Answer for the question is explained in the attachment.

Explanation:

Diffusion flux at 350K for water in polystyrene is equal to

2.8 * 10^-7 .

Download pdf
5 0
3 years ago
Read 2 more answers
Which of the following describes the wireless standard?
Maksim231197 [3]
The awnswer is a. 802.11
7 0
3 years ago
Read 2 more answers
What forced induction device is more efficient?
Anastasy [175]

Answer:

A

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • A fluid has a dynamic viscosity of 0.048 Pa.s and a specific gravity of 0.913. For the flow of such a fluid over a flat solid su
    10·1 answer
  • When fermentation units are operated with high aeration rates, significant amounts of water can be evaporated into the air passi
    13·1 answer
  • At a festival, spherical balloons with a radius of 140.cm are to be inflated with hot air and released. The air at the festival
    10·1 answer
  • Air at 80 °F is to flow through a 72 ft diameter pipe at an average velocity of 34 ft/s . What diameter pipe should be used to
    10·2 answers
  • A slug travels 3 centimeters in 3 seconds. A snail travels 6 centimeters in 6 seconds. Both travel at constant speeds. Mai says,
    6·1 answer
  • A gas is compressed isothermally in a piston-cylinder assembly from 7.6 bar, 77 °C to 3.05 bar. Determine the work and heat tran
    11·1 answer
  • PLEASE HELP! ASAP!!!!
    6·1 answer
  • Ben is an aeronautical engineer who helps build rockets. What talent might help ben in his career?
    14·1 answer
  • Using examples, describe the relationship between accuracy and precision in measurement and their importance in conducting scien
    10·1 answer
  • What type of control would describe training, inspection, and housekeeping?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!