Questions: 9 913

Answers by our Experts: 9 913

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Create a program that will compute the salary of an employee. Salary is computed as hours worked times rate per hour. Rate is based on the inputted employee code. Consider the following:

Employee Code Rate per hour

1 100.00

2 200.00

3 350.00

4 500.00



Write a C++ program that asks the user to enter a number N .After that, print N lines using asterisk (*) in a


triangle shape as shown below;


Sample Input:


Enter number of lines to print: 6

Write a class rectangle and store the length and width of the rectangle. Write a member function called increment that will increment to length and width. Also write the function to find the area of a rectangle and then write the accessor function that will display the length, width and area of the rectangle. Demonstrate the use of the object in the main function.

class rectangle

{

private:

int length, width, area;

public:

}


Write a program to determine whether a year entered through the keyboard is a leap year or not. Also determine whether the year is your year of birth, starting your school, start or end of matriculation (or O-levels etc), start or end of Intermediate education (FSC, A-levels, ICOM, ICS etc) or year of starting your education in COMSATS University?


Create a C++ program that will prompt the user for a line of text. This line of text must be written to a text file called info.txt

Once the line of text has been written, display a text on the screen alerting the user that information has been written to a file successfully.


#include <iostream>


#include <string>


using namespace std;




int main() {


string last, first, middle;


int age;


string birthday;


string gender;


string address;




cout << "Enter you lastname: ";


cin >> last;




cout << "Enter you firstname: ";


cin >> first;




cout << "Enter you middlename: ";


cin >> middle;




cout << "Enter your birthday: ";


cin >> ws;


getline(cin, birthday);




cout << "Enter your age: ";


cin >> age;




cout << "Enter your gender: ";


cin >> gender;




cout << "Enter your permanent address: ";


cin >> ws;


getline(cin, address);




cout << "Hello " << first << " " << middle << " " << last << endl;


cout << "Your birthday is " << birthday


<< " and now you are " << age << " years old." << endl;


cout << "You are " << gender << endl;


cout << "and you live at " << address << endl;




return 0;


With explanation

Exercise 1.1 : Base and ASCII representation of character representation Print the decimal, octal and hexadecimal value of all characters between the start ad stop characters entered by a user. for example, if the user enters an ’A’ and ’H’, the program should print all the characters between ’A’ and ’H’ and their respective values in the different bases (decimal, octal, and hexadecimal) as follows ASCII Representation of D is 68 in Decimal 104 in Octal and 44 in Hexadecimal ASCII Representation of E is 69 in Decimal 105 in Octal and 45 in Hexadecimal ASCII Representation of F is 70 in Decimal 106 in Octal and 46 in Hexadecimal ASCII Representation of G is 71 in Decimal 107 in Octal and 47 in Hexadecimal ASCII Representation of H is 72 in Decimal 110 in Octal and 48 in Hexadecimal ASCII Representation of I is 73 in Decimal 111 in Octal and 49 in Hexadecimal ASCII Representation of J is 74 in Decimal 112 in Octal and 4A in Hex


Write a C program which will take 30 numbers from the keyboard and display the min of these numbers . By using

•for loop

•while loop

•do while loop


Write a C program which will print the pattern on monitor , the integer N will be taken from key board



1


12


123


1234


12345


_____


_____


12345____n


Come up with the remaining loop , flow , and example on each one .

1.while loop

2.do while loop

3.infinite loop


LATEST TUTORIALS
APPROVED BY CLIENTS