How can I get a program like this using Function Overloading in c++?
Example 1:
Enter
A - for comparing integers
B - for comparing float
C - for comparing characters
D - for comparing strings
Enter your choice: a
Enter two integers: 5 10
10 is greater
Example2:
Enter
A - for comparing integers
B - for comparing float
C - for comparing characters
D - for comparing strings
Enter your choice: d
Enter two integers: hello Hi
hello is greater
Write a program that calculates the average number of days a company’s employees are absent. The program should have the following functions:
- A function called by main that asks the user for the number of employees in the company. This value should be returned as an int.
- A function called by main that accepts one argument: the number of employees in the company. The function should ask the user to enter the number of days each employee missed during the past year. The total of these days should be returned as an int.
- A function called by main that takes two arguments: the number of employees in the company and the total number of days absent for all employees during the year. The function should return, as a double, the average number of days absent.
Input Validation: Do not accept a number less than 1 for number of employees. Do not accept a negative number for the days any employee missed.
The Area of a Circle = pi (rr). Where pi=3.1415 and r=Radius, Make a program that will input Radius and compute and display the Area. Your program will be terminated if input zero in the radius.
Write a Program: Competition Score
Your goal is to create a program that will determine the average score for an
athlete in a competition. There are 10 judges who each award a score between 0
and 10. The lowest and highest scores are thrown out, and the athlete’s score is
the average of the eight remaining scores.
You need to create a scorecard file in a text editor or type it into onlineGDB. The
scorecard should have the first and the last name of the athlete on the first line
and 10 space-separated numbers between 0 and 10 on the second line. The
numbers should have at most 1 digit after the decimal point.
Create an Algorithm, Flowchart and C++ program based on the requirements below:
Problem:
Output: 2 Sample Scenario
Even or Odd
Enter a number: 50
The number 50 is Even!
-------------------------------------
Even or Odd
Enter a number: 71
The number 71 is Odd!
Make a program that will compute the quiz,online laboratory,exam scores of the students. The program will input scores for quiz, online laboratory, exam rating. Display also the scores equivalent and if the scores of the students is greater than 75 then remarks will be passed otherwise failed loose and selection and repetion structures. Use these formula.
Enter your full name:
Enter your year and section
Input quiz: score and items
Quiz 1: score and item
11 11
Quiz 2: score and item
10 15
Quiz 3: score and item
10 20
Quiz 10% = 10
Input online laboratory activities: score and items
Lab 1: score and item
15 15
Lab 2: score and item
10 20
Lab 3: score and item
7 20
Lab 30%=30
Input exam: score and items
Exam 1: score and items
20 50
Exam 2: score and items
40 50
Exam 3: score and items
35 50
Exam 1: 20%
Exam 2: 20%
Exam 3: 20%
Final grade = quiz + online laboratory + exam 1 + exam 2 + exam 3
Write a function, triangleShape, that takes as parameters three numbers, each of which
represents the length of a side of the triangle. The function should return the shape of the triangle.
(Note: In a triangle, the sum of the lengths of any two sides is greater than the length of the third
side.)
Write a program that prompts the user to input the length of the sides of a triangle and outputs
the shape of the triangle.
Write a program in C++ that implements a simple arithmetic calculator using enumerator. Create
Operation enumerator with the elements (Add, Sub, Mul, Div). The function Calculate receives two
integer numbers and operation and returns the answer.
Write a program in C++ that creates an enumerator Fruit. Presents the list of fruits to the user and
displays the fruit name according to the number provided by the user.