The robotic team has built a robot that collects pollutants and takes them to a collector bin. The bin holds 1000 pieces of trash. The human worker separates the trash into two categories: Recycle and Reuse. Write a program that calculates and states the amount of pieces of pollutants for recycle and the amount for reuse.
Post your solution as a comment.
Wednesday, October 16, 2019
Tuesday, October 15, 2019
Solution to Algorithm 2 Test #2
'the student council is selling tickets to the dance as follows'
'Junior Dance - $5.00'
'Senior Dance - At door - $15.00 - Advance -$10.00'
'students need an ID for Senior Dance'
'Determine and output the total for a student purchasing ticket(s)'
'This algorithm is written as the solution for algorithm #2 on Test 2'
jd = 5 'jd represents junior dance fee'
sda = 10 'sda represents senior dance fee advanced purchase'
sdd = 15 'sdd represents senior dance fee at the door'
print "Enter 1 for Junior dance ticket purchase"
print "Enter 2 for Senior dance ticekt purchase"
print "Enter 3 for combination purchases"
input num
if (num = 1) then
print "enter the number of junior tickets needed"
input jnum
total = jnum * jd
print "Your total is $", total
end if
if (num = 2) then
print "Enter 1 for advanced purchase or 2 for tickets to pay for at the door"
input ans
if (ans = 1) then
print "enter the number of senior tickets needed"
input snum
total = snum * sda
print "Your total is $", total
else
if (ans = 2) then
print "enter the number of senior tickets you want to reserve"
input snum2
total = snum2 * sdd
print "We are reserving your tickets and you may pick up at the door upon payment."
print "Your total will be $", total
end if
end if
end if
if (num = 3 ) then
print "enter the number of junior tickets needed"
input jnum
jtotal = jnum * jd
print "Enter 1 for advanced purchase or 2 for tickets to pay for at the door"
input ans
if (ans = 1) then
print "enter the number of senior tickets needed"
input snum
stotal = snum * sda
else
if (ans = 2) then
print "enter the number of senior tickets you want to reserve"
input snum2
sdtotal = snum2 * sdd
print "We are reserving your tickets and you may pick up at the door upon payment."
end if
end if
total = jtotal + stotal + sdtotal
total2 = jtotal + stotal
print "Your overalltotal is $", total
print total2 , " is due now and ", sdtotal,"is due at the door"
end if
Print "Thank you for supporting the Student Council"
input key
'Junior Dance - $5.00'
'Senior Dance - At door - $15.00 - Advance -$10.00'
'students need an ID for Senior Dance'
'Determine and output the total for a student purchasing ticket(s)'
'This algorithm is written as the solution for algorithm #2 on Test 2'
jd = 5 'jd represents junior dance fee'
sda = 10 'sda represents senior dance fee advanced purchase'
sdd = 15 'sdd represents senior dance fee at the door'
print "Enter 1 for Junior dance ticket purchase"
print "Enter 2 for Senior dance ticekt purchase"
print "Enter 3 for combination purchases"
input num
if (num = 1) then
print "enter the number of junior tickets needed"
input jnum
total = jnum * jd
print "Your total is $", total
end if
if (num = 2) then
print "Enter 1 for advanced purchase or 2 for tickets to pay for at the door"
input ans
if (ans = 1) then
print "enter the number of senior tickets needed"
input snum
total = snum * sda
print "Your total is $", total
else
if (ans = 2) then
print "enter the number of senior tickets you want to reserve"
input snum2
total = snum2 * sdd
print "We are reserving your tickets and you may pick up at the door upon payment."
print "Your total will be $", total
end if
end if
end if
if (num = 3 ) then
print "enter the number of junior tickets needed"
input jnum
jtotal = jnum * jd
print "Enter 1 for advanced purchase or 2 for tickets to pay for at the door"
input ans
if (ans = 1) then
print "enter the number of senior tickets needed"
input snum
stotal = snum * sda
else
if (ans = 2) then
print "enter the number of senior tickets you want to reserve"
input snum2
sdtotal = snum2 * sdd
print "We are reserving your tickets and you may pick up at the door upon payment."
end if
end if
total = jtotal + stotal + sdtotal
total2 = jtotal + stotal
print "Your overalltotal is $", total
print total2 , " is due now and ", sdtotal,"is due at the door"
end if
Print "Thank you for supporting the Student Council"
input key
Monday, October 7, 2019
Test Outline Updated
Junior 1 Test 2 - Theory - Day 9
Junior 2 Test 2 - Theory - Day 8
Due to an unexpected change in schedule for Day 9, the test will be a Short Test, meaning that it is timed for 40 minutes or less.
The outline is updated as follows:
Part 1 - Multiple Choice (5 points)
5 questions
Part 2 - Structured Questions (45 points)
1 theory question based on control structures (5 points)
2 conditional algorithms (20 points each)
Junior 2 Test 2 - Theory - Day 8
Due to an unexpected change in schedule for Day 9, the test will be a Short Test, meaning that it is timed for 40 minutes or less.
The outline is updated as follows:
Part 1 - Multiple Choice (5 points)
5 questions
Part 2 - Structured Questions (45 points)
1 theory question based on control structures (5 points)
2 conditional algorithms (20 points each)
Thursday, October 3, 2019
Conditional Algorithm Practice Problems
1. Write an algorithm that prompts the user to enter two values stored in A and B. The algorithm should determine the larger value and store it in Max and then output Max.
2. The cost to ride the bus is as follows:
Ladyville $2.00
Sandhill $3.00
Carmelita $4.00
Orange Walk $5.00
Write an algorithm that determines and shows the cost for a person to travel to their destination.
3. The bank changes simple interest rates of 20% on loans valuing more than $10,000.00 and 15% on loans valuing $10,000.00 or less. Write an algorithm that prompts the user to enter their loan value. The algorithm should determine and calculate the interest value and the overall loan total inclusive of the interest. For loans that are $10,000.00 or less, customers must pay the loan in equal monthly payments for 5 years. For larger loans, customers must pay the loan in equal monthly payments for 8 years. The algorithm should also state the monthly payment of the customer, based on their loan value.
2. The cost to ride the bus is as follows:
Ladyville $2.00
Sandhill $3.00
Carmelita $4.00
Orange Walk $5.00
Write an algorithm that determines and shows the cost for a person to travel to their destination.
3. The bank changes simple interest rates of 20% on loans valuing more than $10,000.00 and 15% on loans valuing $10,000.00 or less. Write an algorithm that prompts the user to enter their loan value. The algorithm should determine and calculate the interest value and the overall loan total inclusive of the interest. For loans that are $10,000.00 or less, customers must pay the loan in equal monthly payments for 5 years. For larger loans, customers must pay the loan in equal monthly payments for 8 years. The algorithm should also state the monthly payment of the customer, based on their loan value.
Subscribe to:
Posts (Atom)