Tutorial Task 1.2 - Answers.pdf - Answers to Questions from TT1.2 Name Student ID 1 Desk Check Task Calculate Bill Total Required Variables Integer

Tutorial Task 1.2 - Answers.pdf - Answers to Questions from...

This preview shows page 1 - 3 out of 4 pages.

Answers to Questions from TT1.2 Name: Student ID: 1. Desk Check Task: Calculate Bill Total Required Variables: Integer: appetizer_price, main_price, dessert_price Real (floating point): total_price Pseudocode: Read the value of appetizer_price Read the value of main_price Read the value of dessert_price total_price = appetizer_price + main_price + dessert_price Print ‘$’ then the value of total_price to the terminal showing two decimal places. Test Data: appetizer_price main_price dessert_price Expected Result: Output: First data set Second data set 10.30 12.40 34.00 41.00 8.50 9.80 First data set Second data set $52.80 $63.20
Desk check - fill this in by completing the missing code in bill_total.rb (in the tasks Resources folder) then running it with the test data above: Statement appetizer _price main _price dessert _price total _price output First Pass Read the value of appetizer_price 10.30 Read the value of main_price 34.00 Read the value of dessert_price 8.50 Calculate the total_price 52.80 Convert to dollars $52.80 Output the total_price $52.80 Second Pass Read the

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture