This Graded Project promotes the following learning outcomes: · Select and implement appropriate data types, expressions and control structures to solve simple, typical programming problems Complete...

1 answer below »























This Graded Project promotes the following learning outcomes:


·
Select and implement appropriate data types, expressions and control structures to solve simple, typical programming problems
















Complete the following exercises







1. Given two defined variables: (1 point)


· A float named

totalWeight

that has the weight of a shipment


· An int named

quantity


,

that has the number of items in the shipment.


Write an
instruction
that calculates the weight of
one item and stores it in a variable named
cost4One
.



2. Given that a variable named

average
, has already been calculated, write an
expression
that is True if and only if average is
less
than 60.5. (1 point)



3. Assume: 3 counter variables named

minors, adults
, and

seniors

have been defined with starting value 0 and variable

age
has received valid input from the keyboard. Write an
if/else
statement that adds 1 to

nminors

if age is
less
than 18, adds 1 to

adults

if age is 18 through 64 and adds 1 to

seniors

if age is 65 or older. (2 points)



4. Write a loop that reads positive integers from keyboard input and will stop executing when it reads an integer that is not positive. After the loop ends, it prints out
the sum of all the even integers read. Name your variable whatever you like. (2 points)



5. Write a

for

loop that prints in ascending order all the positive multiples of 5
that are less than
175, each on a separate line. (2 points)

Answered 2 days AfterOct 12, 2021

Answer To: This Graded Project promotes the following learning outcomes: · Select and implement appropriate...

Arun Shankar answered on Oct 14 2021
134 Votes
'''
1.
cost4One = totalWeight / quantity;
2.
(average < 100)
3.
if(age < 18):
minors += 1
elif(age <= 64):
adults += 1
else:
seniors += 1
4.
a = 0
total = 0
while(a >= 0):
a = input()
if((a > 0) and (a % 2 == 0)):
total += a
print(str(total))
5.
'''
for i in...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here