CSC 1100 Lecture 1: CSC1101_Lab01

287 views2 pages
CSC 1101 – Problem Solving and Programming Laboratory
Lab Assignment 01 – [your name]
25 points – Due September 13, end-of-class
a) Save this document with your name and the lab assignment number in the file
name, e.g., CSC1101_Lab01_Bill_Gates.docx.
b) Type/paste your answers into the document.
c) Submit this document to the Blackboard item where you downloaded this
document.
Q1. Write a program to calculate the salary for an employee. Declare the following
variables: numHours, salPerHour and totalSal of type float and name of type
string.
(1) Prompts the user to enter values for numHours, salPerHour and name.
(2) Calculate the total salary for the person using numHours and salPerHour and
store it in totalSal.
(3) Display name and total salary of the person as output.
//==========================================================
//
// Title: <Lab 1: Employee Salary>
// Course: CSC 1101
// Lab Number: <3>
// Author: <Akshatha Kumar>
// Date: <09/13/16>
// Description:
// <Determines the total amount of salary>
//
//==========================================================
#include <iostream> // For cin, cout, and system
#include <string> // For string data type
using namespace std; // So "std::cout" may be abbreviated to "cout", for example.
int main()
{
// Show application header
cout << "Welcome to Salary Calculator" << endl;
cout << "--------------------------" << endl << endl;
// Application processing here
float totalSal;
int numHours;
int salPerHour;
string name;
cout << "Enter the number of hours";
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Get OneClass Notes+

Unlimited access to class notes and textbook notes.

YearlyBest Value
75% OFF
$8 USD/m
Monthly
$30 USD/m
You will be charged $96 USD upfront and auto renewed at the end of each cycle. You may cancel anytime under Payment Settings. For more information, see our Terms and Privacy.
Payments are encrypted using 256-bit SSL. Powered by Stripe.