Briefly explain what an array is. As part of your answer make use of a labelled example to show the declaration and components of an array Note: You will receive 4 marks for your explanation and 6 marks for your labelled example.
Answer the following questions in your own words:
identify the purpose and components of the method represented in the pseudocode below:
num calAverage(num total)
declarations
num average
set average = total/2
return average
C++ PROGRAMMING
The "TRC Institute" records and monitors performance of three (3) machines over a period of four (4) days (l to 4) as shown in the Table 1, 2 and 3 respectively. The production ranges between 15.5 and 75.5
Table 1- Machine "A" Production
Day 1 2 3 4
Array index 0 1 2 3
Production 15.5 25.5 27.5 60.5
Table 2- Machine "B" Production
Day 1 2 3 4
Array index 0 1 2 3
Production 50 45.5 25.5 18
Table 3- Machine "C" Production
Day 1 2 3 4
Array index 1 2 3 4
Production 35.5 65 71 74.5
Write a function using C++ statements called PrintChart() which takes three float arrays (valuel, value2, value3) and an integer (as day) as parameters. The function calls GetProduction and PrintBar functions to print the output as given below.
Sample Output.
Day 1
Machine A **
Machine B *****
Machine C ****
Jane wants to become a doctor. If Jane obtains an average of 90% for
Maths in her final exams, she will be admitted to the qualification, however,
if she obtains an average of more than 85% but less than 90% for Maths
and an overall average of 90% for all her subjects she will still be able to
study medicine but will have to complete a BSc degree first.
Write the pseudocode that will accurately reflect the logic
contained in the above scenario.
Create the pseudocode that will demonstrate how an application will write
your name and surname to a text file called “students.dat”.
Write a C++ program for implementing the following
a. Create a class called Employee with Employee name, Designation and Basic Pay as data members.
b. Inherit a class called Allowance from Employee with HRA and DA as data members
c. Inherit a class called Deductions from Employee with PF and Income Tax as data members
d. Inherit class Salary from Allowance and Deductions which has Net pay as its data member.
Create an array of employees, calculate net pay for each employee and sort them (using operator overloading).
Create the pseudocode that will demonstrate how an application will write your name and surname to a text file called “students.dat”.
By making use of pseudocode, show the programming statements that will accept two values from a user. These values should be added together and the result displayed on the screen.
Jane wants to become a doctor. If jane obtains an average of 90% for maths in her final exams, she will be admitted to the qualification, however, if she obtains an average of more than 85% but less 90% for maths and an overall average of 90% for all her subjects she will still be able to study medicine but will have to complete a BSc degree first. Write the pseudocode that will accurately reflect the logic contained in the above scenario