15 Sep 2016
School
Department
Course
Professor

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