Class=1 If sales is equal to or less than $1000, the rate is 6 percent. If sales is greater than $1000 but less than $2000, the rate is 7 percent. If the sales is $2000 or greater, the rate is 10 percent. Class=2 If the sales is less than $1000, the rate is 4 percent. If the sales is $1000 or greater, the rate is 6 percent. Class=3 The rate is 4.5 percent for all sales amount Class=any other value Output an appropriate error message
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. 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.
Example Input File:
Mirabella Jones
7.5 8.8 7 8.1 8 9.8 9.3 8.9
Example Output:
First run
ERROR: the scorecard could not be opened
Second run
Insufficient scores
Mirabella Jones is disqualified
Third run
Invalid scores
Mirabella Jones is disqualified
Fourth run
Mirabella Jones's results:
7.5, 8.8, 7.0, 8.1, 8.0, 9.8, 9.3, 8.9
The highest score of 9.8 and the lowest score of 7.0 were dropped
The average score is 8.59
Discuss Gates & Flip Flops in Microprocessors
How to calculate arithmetic in python programming
Let’s build a sample banking program to perform the common tasks like Withdraw and Deposit.
In this question, you are required to write C++ code that checks whether the number
entered by the user is a happy number or not for 10 cycles/iterations only.
Example: Assume a number 19
Number Computation Result cycle/iterations
19 1
2 + 9
2 82 1
82 8
2 + 2
2 68 2
68 6
2 + 8
2 100 3
100 1
2 + 0
2 +0
2 1 4
Create a C# console application that prints the Area of a square.
The application must use OOP concepts:
Create an abstract class named ShapesClass.
ShapesClass must contain an abstract method named Area.
Create a class named Square that inherits from ShapesClass.
Square class must contain a Square method.
Create a method named Area that will override abstract method Area, and then return the sides of the square.
In the main method create an object of the square class, with the value of the side. Print the Area of the square.
How to convert basic data to user defined data type?
There is a secret organization and they
want to create a secret language for the
calculation to make the data secure.
Now the manager of the organization
asked his IT employee to make the
program which will function as follows:
a) * will subtract the numbers b) - will
divide the numbers c) / will add the
numbers d) + will multiply the numbers.
Use operator overloading.
Write a program to find if a year is a leap year or not. We generally assume that if a year number is divisible by 4 it is a leap year. But it is not the only case. A year is a leap year if −
1. It is evenly divisible by 100
2. If it is divisible by 100, then it should also be divisible by 400
3. Except this, all other years evenly divisible by 4 are leap years.
So the leap year algorithm is, given the year number Y,
● Check if Y is divisible by 4 but not 100, DISPLAY "leap year"
● Check if Y is divisible by 400, DISPLAY "leap year"
● Otherwise, DISPLAY "not leap year"
For this program you have to take the input, that is the year number from an input file input.txt that is provided to you. The input file contains multiple input year numbers. Use a while loop to input the year numbers from the input file one at a time and check if that year is a leap year or not. Your output should go in the console.