Define the following modules below the main function:
a function to determine the ticket price based on the received seating section code.(7)
a void function to accumulate total amounts made per sitting section(5)
a void function that will generate 5 numbers to represent winners, ensure that the
function does not duplicate numbers and store the winning numbers in an array called
luckyCust. (
T is an array of N integers. N is defined as a constant equal to 10.
Write a procedure proc1(int *T) that reads the N elements of the array by checking that the entered values are between 10 and 20. This procedure will display thereafter the N values of the array, the sum value, the maximum value and the minimum value of elements in this array.
Consider the association relationship between the class Customer in question 2 above and a class Invoice where the Customer class is a member of the Invoice class. Write the codes for the Invoice class and a test driver to test all the public methods
In a college the faculty member wants find a student with help of their register number, now he wants to compare the register no. one by one and to find the corresponding person. Use the suitable searching technique.
The Customer class models a customer using as shown in the class diagram below. Write the codes for the Customer class and a test driver to test all the public methods. Note that a discount is given as a percentage. The toString() method should output the customer information including the ID, name and discount
Create a class named Employee. Employees are identified by their employee number,
last name, first name and salary.
Create the necessary instance variables and methods for the class Employee.
In your main project, create at least five (5) employee records and display each record.
Employee’s data must be based on data entry from the user.
Find latitude and longitude of first 20 countries with a population greater than or equal to the population limit given below. Use the country details from this dataset.
Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.
Test #2:
Find the bug and write the correct version of the program
#include <iostream>
class Utils
{
public:
static double findAverage (int number1, int number2)
return number1 + number2 / 2;
};
}
int main()
std::cout << Utils::findAverage(5, 2); // it should return 3.5
}
Test #3 (optional):
Please find and explain all the errors in the following function. There is at least one of the
following:
1. Compilation error
2. Segmentation fault
3. Performance issue
Flight minFlight(std::vector<Flight> flights)
{
std::sort(flights.begin(), flights.end()); return flights.begin();
}
Also, write the correct version of the program.
1. Write a c++ program that sum's up the even numbers between 0 and
any positive integer number n given by the user.
Create a C program that will generate a table of chosen mathematical operations. The user has to be prompted first for the math operation and then enter a value that will be used to add, subtract, multiply or divide from 1 to 10 to complete the table.
Sample Run:
M A T H O P E R A T I O N S:
[M] – Multiplication
[D] – Division
[A] – Addition
[S] - Subtraction
Enter your choice: M
Enter your desired value to be multiplied: 8
1*8=8
2*8=16
3*8=24
4*8=32
5*8=40
6*8=48
7*8=56
8*8=64
9*8=72
10*8=80
Continue [Y/N]? Y
M A T H O P E R A T I O N S:
[M] – Multiplication
[D] – Division
[A] – Addition
[S] - Subtraction
Enter your choice: A
Enter your desired value to be added:4
1+4=5
2+4=6
3+4=7
4+4=8
5+4=9
6+4=10
7+4=11
8+4=12
9+4=13
10+4=14
Continue [Y/N]? N
Thank you for choosing my program