CECS 100
LAB ASSIGNMENT 3
Assigned date:
 9/25
Due date:   
Wednesday 10/2
40 points

Objectives:

In this lab, you learn to create a Raptor flowchart.

After completing this lab, you will be able to:

Pre-Lab

Do the following activities before doing the lab assignment. 

Problem 1 [10 points]

Diana Lee, a supervisor in a manufacturing company, wants to know which employees have increased their production this year over last year so that she can issue them certificates of commendation and bonuses. Design a Raptor flowchart  for following: 

A program that accepts each worker’s first and last names, this year’s number of units produced, and last year’s number of units produced. Displays the name and a bonus amount. The bonuses will be distributed as follows: 

If this year’s production is greater than last year’s production and this year’s production is:

Output #1

Enter last name:
Nguyen
Enter first name:
John
Enter this year's units:
3000
Enter last year's units:
4000
Nguyen, John
Bonus is $0.0

Output #2

Enter last name:
Nguyen
Enter first name:
John
Enter this year's units:
900
Enter last year's units:
300
Nguyen, John
Bonus is $25.0

Output #3

Enter last name:
Nguyen
Enter first name:
John
Enter this year's units:
2500
Enter last year's units:
2000
Nguyen, John
Bonus is $50.0

Output #4

Enter last name:
Nguyen
Enter first name:
John
Enter this year's units:
4500
Enter last year's units:
4000
Nguyen, John
Bonus is $100.0

Output #5

Enter last name:
Nguyen
Enter first name:
John
Enter this year's units:
7000
Enter last year's units:
6000
Nguyen, John
Bonus is $200.0

Grading

Name the Raptor flowchart file as lab41.rapDo not change the file name to any other name. Submit the file to the Beachboard.

Problem 2 [10 points]

Redo the problem 1 using Python. Name the file lab42.py.

Grading

Name the Raptor flowchart file as lab42.pyDo not change the file name to any other name. Submit the file to the Beachboard.

Problem 3 [10 points]

The formula for converting a temperature from Celsius to Fahrenheit is 

                         F =  9.0  C  + 32
                                  5

Create a Raptor flowchart to display a table of the Celsius temperatures from 0 to 15 and their Fahrenheit equivalents. Name the file lab43.rap.

Sample output

Celsius  Fahrenheit

0           32.00
1           33.80
2           35.60
3           37.40
4           39.20
5           41.00
6           42.80
7           44.60
8           46.40
9           48.20
10         50.00
11         51.80
12         53.60
13         55.40
14         57.20
15         59.00

Hints:

  1. Display "Celsius        Fahrenheit" using the Raptor output symbol
  2. Set the counter variable celsius to 0
  3. Insert the Raptor loop structure. The loop condition is celsius <=15.
    If the condition is true, the calculate fahrenheit as fahrenheit = 9.0/5.0 * celsius + 32.
    Display celsius and fahrenheit using the output symbol. 
    celsius + "           " + fahrenheit
    Increment celsius by one  celsius = celsius + 1
  4. If the condition is false (No), then end the Raptor flowchart

Grading

Name the Raptor flowchart file as lab43.rapDo not change the file name to any other name. Submit the file to the Beachboard.

Problem 4 [10 points]

Convert the flowchart in the problem 3 into a Python program.

Grading

Name the Raptor flowchart file as lab44.pyDo not change the file name to any other name. Submit the file to the Beachboard.

Grading

 

Lab assignment Grading Rubric
Criteria Approx. % of Grade Excellent (100%) Adequate (80%)  Poor (60%) Not Met (0%)
Program Specification /Correctioness 50%(10 points) No errors, program always works correctly and meets the specification(s). Minor details of the program specification are violated, program functions incorrectly for some inputs. Significant details of the specification are violated, program often exhibits incorrect behavior. Program only functions correctly in very limited cases or not at all.
Readability 20% (4 points) No errors, code is clean, understandable, and well-organized. Minor issues with consistent indentation, use of whitespace, variable naming, or general organization. At least one major issue with indentation, whitespace, variable names, or organization. Major problems with at three or four of the readability subcategories.
Documentation 10% (2 points) No errors, code is well-commented. One or two places that could benefit from comments are missing them or the code is overly commented. File header missing, complicated lines or sections of code uncommented or lacking meaningful comments. No file header or comments present.
Code Efficiency 15% (3 points) No errors, code uses the best approach in every case. No errors, code uses the working approach in every case.  Code uses poorly-chosen approaches in at least one place. Many things in the code could have been accomplished in an easier, faster, or otherwise better fashion.
Assignment Specifications 5% (1 point) No errors N/A Minor details of the assignment specification are violated, such as files named incorrectly or extra instructions slightly misunderstood. Significant details of the specification are violated, such as extra instructions ignored or entirely misunderstood.