This document provides an explanation of the C source files and executables included in the Lab 1 and Lab 2 submissions.
- Purpose: Demonstrates the use of
printf()and escape sequences in C. - Key Features:
- Prints text containing quotes, backslashes, new lines, and percentage signs.
- Helps practice formatted output and escape characters.
- Executable:
lab1part1.exe- Run in terminal/CLI to view the output.
- Purpose: Calculates the total bill including tip and splits it among multiple people.
- Inputs:
- Original bill amount (float).
- Tip percentage (integer or float).
- Number of people (integer).
- Outputs:
- Total bill including tip (2 decimal places).
- Each person’s share of the bill (2 decimal places).
- Executable:
lab1part2.exe- Run the program and follow the prompts to test different scenarios.
- Purpose: Converts weight from kilograms to pounds and ounces (with fractional remainder).
- Key Fixes Made:
- Corrected syntax errors (
==replaced with=, missing semicolons fixed). - Corrected type usage (
doublefor weights,intfor truncated values). - Fixed incorrect
scanf()format specifier.
- Corrected syntax errors (
- Executable:
lab1part3.exe- Run and enter a weight in kilograms. Program outputs pounds, ounces, and fractional remainder.
lab1part1.c+lab1part1.exelab1part2.c+lab1part2.exelab1part3.c+lab1part3.exeLab1and2Reportbmcrae03.pdfREADME.md(this file)
- If executables fail to run on another system, recompile using the provided
.csource files.