Assignment_2_Fall2020 - Name Date Class/Section CSC-115...

This preview shows page 1 - 2 out of 2 pages.

Name: Date: Class/Section: CSC-115 Assignment #2 Most of this information can be found in chapter 3 and chapter 4 of your book. Please do your best to solve each problem. 1. Find the error in the following pseudocodes. (2 points)
Module main() Call getCalories() End Module Module getCalories() Declare Real calories Display "How many calories are in the first food?" Input calories Declare Real calories Display "How many calories are in the second food?" Input calories End Module B. Module main() Declare Real mileage Call getMileage() Display "You've driven a total of ", mileage, " miles." End Module Module getMileage() Display "Enter your vehicle's mileage."
Input mileage End Module 2. Design a modular program that asks the user to enter a distance in kilometers, and then converts that distance to miles. The conversion formula is as follows: (1.5 points)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture