0% found this document useful (0 votes)
50 views2 pages

PRG155 Lab 02

This lab's objective is for students to write their first programs independently using the development environment. Students will create a travel speed calculation program and take a screenshot of it running. They will then create a unit conversion program, take a screenshot, and submit both for grading.

Uploaded by

Raeid Jim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views2 pages

PRG155 Lab 02

This lab's objective is for students to write their first programs independently using the development environment. Students will create a travel speed calculation program and take a screenshot of it running. They will then create a unit conversion program, take a screenshot, and submit both for grading.

Uploaded by

Raeid Jim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PRG155 Lab 02 © M.

Heidenreich, Seneca Polytechnic

Lab Summary
This lab’s objective is to become more comfortable with the development environment and to write your
first programs independently. Unless told otherwise, you may use any editor and compiler in PRG155 from
now on.

Instructions – Part A (Average Travel Speed)

1. Create a new Project/Solution on your PC using either Visual Studio or VS Code.

2. Add a C source file to your project, containing code shown below. Fill in the “Student” and “Date”
lines. Make sure that you understand what each line of the program does, including the #define
line at the top of the program. Use Internet resources as needed.

3. Compile your travel.c program to make sure that there are no mistakes. You can run the program
if you like, but there will be no output displayed at this point.
4. Add necessary code for the three TODO tasks shown inside main(), replacing (removing) the
comments as you go, using scanf to get input.

Your finished program, when using 300 and 210 as input, should provide output as follows:

Make sure that your program does not show errors or warnings when compiled and run, although warning
about scanf return value is OK. Format your code well by indenting all code inside main() by one tab
and by using single blank lines to separate program sections – variable declaration, user input,
calculations, output and return. With the exception of prompts, printf statements should end with ‘\n’.
Use a ‘fflush(stdout);’ statement after any printf that does not end with ‘\n’.

Page 1
PRG155 Lab 02 © M. Heidenreich, Seneca Polytechnic

5. Run your program and enter 111 as distance travelled and 95 as total travel time. Verify that
your calculation are correct using a calculator.

6. Increase the font size in program output window to at least size 22 and take a screenshot of your
screen, making sure your entire program code (in editor) and the running program output are
visible at the same time.

Save the screenshot as prg155-lab02-a.png for lab grading purposes.

Instructions – Part B (Own Project)

Create a new project. Based on what you have learned so far in the PRG155 course, add a simple program
to your new project, which will convert between two measure units of your choice – weight, length,
temperature etc. Your program will need to ask the user for a float value input, perform a calculation,
storing the result in a float variable, and display the result.

As before, take a screenshot of your screen (prg155-lab02-b.png), making sure that your entire program
code (in editor) and running program’s output are visible at the same time.

Lab Submission for Credit

Work submitted for grading must be completed by each student individually. Ask your lab professor for
clarification and help, not other students. Also, do not provide help to other PRG155 students. Sharing
even a portion of a program source file with other students is not allowed. Please see the following for
details: https://www.senecapolytechnic.ca/about/policies/academic-integrity-policy.html

You can find the upload link for Lab 02 on the Learn@Seneca PRG155 lab homepage under Labs, assuming
that you completed Lab 01 first to meet minimal expectations.

Please review Grading Rubric posted and follow submission requirements posted with the upload link. As
before, Lab credit will depend on quality, completeness and timeliness of your submission. A submission
received more than 2 hours after due date is eligible for 50% lab credit maximum.

You may re-submit the lab for higher credit, but full credit for re-submission is only available if original
submission is received by the due date and re-submission is received by Wednesday following the due
date. A re-submission received after a late original submission, or received more than five days after due
date, is eligible for 50% lab credit maximum.

Due date extensions will not be granted to individual students. It is the student’s responsibility to
manage their time to complete the assigned work ahead of due date, seek help from the professor as
needed, and determine whether a re-submission is applicable, based on feedback posted on
Learn@Seneca. Expect feedback/marking within 3 business days from submission.

Page 2

You might also like