Create a class called time that has separate int member data for hours, minutes, and
seconds. One constructor should initialize this data to 0, and another should initialize it
to fixed values. Another member function should display it, in 11:59:59 format. The final
member function should add two objects of type time passed as arguments. A main() program should create two initialized time objects (should they be const?) and one that isn’t initialized. Then it should add the two initialized values together, leaving the result in the third time variable. Finally it should display the value of this third variable. Make appropriate member functions const.
Make Class Students, having
1. Private data items (First Name, Full Name, Address),
2. Public member functions, getData, showData.
3. Main () function
Create Array of objects (students), (maximum 5 students), call member functions
getData, showData const
Explain the start up process of a computer clearly indicating the purpose of the POST, BIOS and CMOS
Solve the following problem by showing the design of your solution as an algorithm.
The problem – The program will take two integers from the user, say n1 and n2. It will then print the sum of all numbers between n1 and n2, inclusive. For example, if the user enters 5 and 9, the program will print the value of 5+6+7+8+9. On the other hand, if the user enters 5 and -2, the program will print the value of 5+4+3+2+1+0+(-1)+(-2). Note: Do not assume the user will always enter the smaller number first.
create two variables one containing the uppercase character G and the other with uppercase letter O you can want as long as its a valid name that is accepted in c++ print out the values of the varaiable in alternate order, twice, on seperate lines, using the std::cout function the outpit generated by your code must be the same as that of the sample output
Write a C++ program that
1) prompts the user to input 3 decimal numbers (with a fraction part)
2) Prints the five decimal numbers.
3) Converts each decimal number to the nearest integer.
4) Prints the five converted numbers.
Write a C++ program that
1) prompts the user to input 5 decimal numbers (with a fraction part)
2) Prints the three decimal numbers.
3) Converts each decimal number to the nearest integer.
4) Prints the three converted numbers.
Code a C++ program that will display the value of a given variable, and reference to another address, then, the value point-to another address. Given the value of variable is equal to 750.
1. Data items: M , W , L, T, P
2. Constructors: Defualt, Parameterized, Copy
3. Member functions: getdata(), setData(), showdata() const
4. Static class data: total number of teams (objects) created
5. Constant Object : e.g LQ
The XYZ Telephone Company’s charges file, contains records for each call made by its subscribers during a month. Each record on a file contains the subscriber’s name and phone number, the phone number called, the distance from Shah Alam of the number called (in kilometres) and duration of the call in seconds.
Design an algorithm that will read the Tidy Phones charges file and produce a telephone charges report, as follows:
The cost of each call is calculated based on table 1.
Distance from Metroville
Cost($)/minute
Less than 25 km
0.35
25 <= km < 75
0.65
75 <= km < 300
1.00
300 <= km <=1000
2.00
Greater than 1000 km
3.00
Write C++ complete programs for the above problem. You program must use control structure and user defined function.