Business > Lab Report > ICT159 Foundations of Programming Lab Practice 3 (All)

ICT159 Foundations of Programming Lab Practice 3

Document Content and Description Below

ICT159 Foundations of Programming Lab Practice 3 LEARNING OBJECTIVES  Understand the basic requirements of a selective algorithm.  Be able to construct a simple and efficient series of condi... tions in order to solve a selective problem.  Apply the nested if-else structure to solve a selective problem.  Understand how to select test data in order to maximise the effectiveness of algorithm and program testing.  Learn how to identify when to use constants in your program in order to simplify and enhance the readability of your code. FOR THIS LAB YOU MUST SUBMIT…  Your algorithm from part 1.  Your test table from part 2.  Your source code and executable for part 3. 1. (Design/Problem Solving exercise 1) Create an algorithm for a program that simulates the fines issued to drivers based on speeds recorded by a police radar gun. The algorithm should read the recorded automobile speed (in km/h) as an integer and print the message “Speeding” if the speed exceeds 60 km/h or “Not Speeding” if the speed 60 km/h or less. The algorithm should then calculate the appropriate fine (if applicable). If the speed is 5 km/h or less over this limit, only issue a warning. If the speed is more than 5 and no more than 10 km/h above the limit, the fine is $80. For a speed of more than 10 but no more than 20 km/h above the limit, the fine is $150. For a speed of more than 20 km/h above the limit, the fine is $500. You should give some thought as to the type of data you are working with before beginning to design your solution. You should also consider what to do if a negative number is input. Speed cameras do not register negative numbers, so they should not be accepted as input. - 1 -ICT159 Foundations of Programming Note: data type is assumed to be int (i.e. and integer); for the purpose of this exercise, DO NOT use floating point numbers. Also, 60 or less means the speed can be 60 but no more; this is not speeding. Exceeds 60 means the speed is over 60 and therefore speeding. This same logic applies when considering the other speed categories and can be viewed as follows: 61-65 inclusive = warning 66-70 inclusive = $80 71-80 inclusive = $150 81 or more = $500 - 2 -ICT159 Foundations of Programming 2. (Design/Problem Solving exercise 2) Please read the notes at the end of this worksheet before working on this exercise; it discusses how to create and apply test data. Use the test table template below and the test descriptions as hints to define suitable test data to test your algorithm for question 1 and the program you will write for question 3. You should enter values into the last four columns for each test (i.e. row). Do not write the program yet! Once you identify suitable inputs and have filled in that column, then you should identify what outputs you expect. Read the information at the end of this lab about selecting suitable test data. Test # [Show More]

Last updated: 1 year ago

Preview 1 out of 10 pages

Reviews( 0 )

$10.00

Add to cart

Instant download

Can't find what you want? Try our AI powered Search

OR

GET ASSIGNMENT HELP
45
0

Document information


Connected school, study & course


About the document


Uploaded On

May 30, 2021

Number of pages

10

Written in

Seller


seller-icon
Expert Tutor

Member since 3 years

57 Documents Sold


Additional information

This document has been written for:

Uploaded

May 30, 2021

Downloads

 0

Views

 45

Document Keyword Tags

Recommended For You


$10.00
What is Browsegrades

In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Browsegrades · High quality services·