The program should behave as follows. 1. The program reads an integer and stores it in a variable year of type int. 2. If the number is not between 2000 and 2100 (with both ends included), the program should warn the user and stop (this just means that no further statements are executed by the program). Otherwise, it should proceed as follows. 3. Declare a variable leapYear of type bool which will be true if the number stored in year corresponds to a leap year, and false otherwise. 4. Use a loop to compute the value of leapYear according to the year introduced by the user. Hint: keep subtracting 4 from the value stored in year until reaching a certain condition. 5. Use year and leapYear to output the following to the screen: - if year is not a leap year, for example 2010, print The year is 2010 and it's not a leap year. - if year is a leap year, for example 2020, print The year is 2020 and it's a leap year.
create a c++ program an internet cafe has 10,500.00 income per day. compute the total income within 30 days within 4 quarters and within 1 year. the shop will pay P2599.00 for the internet, p10000.00 the electricity and p2500.00 the maintenance
Write a program that reads a 4 digit (or fewer) positive integer and determines
how many digits in the integer are equal to the last character of your Roll number,
and prints the result on the screen. If a user enters a negative integer or an
integer greater than 4 digits, print a message on the screen: “Invalid integer!
Execute program again and enter a valid integer.” Also, write the pseudocode for
this program.
Make all the
appropriate function constant. Include a constant data member called id of integer
type.
Create two object constant and non-constant. Assign values and display them. Also
check what happens
If you try to modify private data member of an object from the definition of
const function
If you try to modify the private data member of const object from the
definition of non-constant function.
Write a definition of class named Race. It has following private data member
carNo (int)
driverID (int)
carModel (int)
The class has one constructor Race (int, int, int) that initializes the values of carNo,
driverID and carModel. Race class has following member functions
void InputValues( ) // this will be used to input values of data member of Book
object from user
void setValues(int cn, int di, int cm); // it will assign values of cn, di and cm to
carNo, driverID and carModel respectively
void display( ); // it displays the value of private
Create two object of Rave class. Assign values using InputValues and setValues function and display them using display function.
Area of a circle is π × r2 where r = radius
Area of a triangle is ½ × b × h where b = base, h = height
Area of a rectangle is w × h w = width, h = height
Area of a square is a
2 where a = length of side
Write four different functions with same name that is Area to calculate the area of
circle, triangle, rectangle and square.
At the end of a financial year a company decided to give bonus for their employees. The bonus for each employee is calculated as n times of their basic salary. n is a number between 0 and 2.
You are asked to write a C program to calculate the bonus given for the employees.
Write a function called calcNoOfTimes() to calculate and return the number of times for each employee. Number of times depend on the employee category as shown in the following table.
Employee Category No of times
1 1.0
2 1.5
Other ( 3 - 9) 2.0
In your main function enter the employee category and the salary of an employee from the keyboard. Calculate and display the bonus given for the employee using the above implemented functions.
Enter Salary : 15000.00
Enter employee number : 2
Bonus : 22500.00
Write a function to sort data. (in increasing order) in an array using
a. pass by value
b. and pass by reference.?
Write a. program that inputs a string value from the user and displays it in
reverse using pointer.?