Create a program that takes in a student first name and average mark obtained, the system should the group the students using the first vowel in their name. For example if the student name is Jena, then the student belongs to group E and if the name was Jack then the student belongs to group A[HINT: Make use of the indexOf() and contains() methods from the string class]. The program should further categorize the mark is follows:
Marks obtained
Grade Level
Message
80 – 100
1
Magnificent!!
70 – 79
2
Excellent!!
60 – 69
3
Good work!!
50 – 59
4
Good!!
0 – 49
Fail – Try again next Year!!
Greater than 100 or
less than 0
X
Invalid Marks!!, Marks too high. Or Invalid Marks!!, Negative marks not allowed.
Sample run 1:
Enter student full names: Johnathan
Enter average mark obtained: 88
Output: Hi Johnathan, you were placed in group O
Grade Level: 1
Comment: Magnificent!!
Using a while loop create a program that calculates the monthly salary of N employees[where N is the number of employees that's entered by the user]. If the employee worked less or equal to 160 hours, the employee will be paid N$240.00 per hour. For any hours greater than 160, the employee is paid N$320.00 per hour.
Sample Run1
Enter number of employees(N):3
Hours worked 1: 160
Hours worked 2: 200
Hours worked 3: 80
Output1:
Salary 1: N$38400.00
Salary 2: N$51200.00
Salary 3: N$19200.00
Sample Run 2
Enter number of employees(N):0
Output2:
No employees provided to do calculations
Sample Run 3
Enter number of employees(N):-4
Output 3:
Number of employees cannot be negative
The Vending Machine
PART I : Program Functionality
The program / Application approach is entirely up to you, so long as it follows the description
above. In addition innovation and creativity will be an added advantage, however below are
guidelines to follow:
1. Planning in forms of Pseudocode and Flowcharts
2. Two stage authentication for owner
3. Data storage using data Structures such Arrays etc.
4. Receipt information calculations and formatting
5. Change calculations and print out
6. Management options by Admin
7. Customer options and interactions
PART II: Program formatting and presentation
The source code will be marked according to the following indicators.
9. Good modular designs within same program file, different methods per functionality
10. Good comments
11. Ability to explain a portion of the code as may be required by the evaluator
Complete with necessary functions this example code to implement a solution to the producer consumer problem discussed in class using Posix threads and semaphores. Assume that there is only 10 producer and 10 consumer. The output of your code should be similar to the following and it must run in infinite loop
Write a recursive function power (x, y) that calculates the value of x to the power.
Let b is a real number. Let n be a non-negative integer. Assume
b and n are not simultaneously 0. Write iterative and recursive functions that return value of bn , the nth power of b.
follow the following methods’ details :
powerRecursive()
• Return the computed nth power of b
powerIteration()
• Receive the values of b and n from main() and compute the nth power of b iteratively
• Return the computed nth power of b
main()
Sample Output:
Enter value of b:3
Enter value of n: 6
6th power of 3 is 729. --> This is displayed through Iterative Method.
6th power of 3 is 729. --> This is displayed through Recursive Method.
Using a whole loop create a that calculates the monthly salaryof N [ where N is the number if employees that's entered by the user.] If the employee worked less or equal to 160 hours, the employee wilk be paid N$240.00 per hour. For any hour greater than 160, the employee is paid N$320.00 per hour.
Create a program that takes in a sentence from user input, the program then removes the last word and first word in the sentence. The remaining string is converted to upper case then printed out. [Hint: In case there is only two words, an empty line is printed]
Sample run 1: Sample run 2:
Enter a sentence: Hello There Enter a sentence: Happy Thursday Everyone
Output: Output: THURSDAY
Create a program that takes in a student first name and average mark obtained, the system should the group the students using the first letter in their name modulus 10 [ Remember that characters are considered as numeric values, hence ‘J’%10 is a valid calculation ]. For example if the student name is Cena, then the student belongs to group 7 because ‘C’%10 = 7 and if the name was Jack then the student belongs to group 4. The program should further use the group number to get the group lecturer and class date as follows: [Hint: If the result is 0 then the student belongs to group 10]
Using a for loop create a program that will prompts the user for two numbers and then print out a summation list of all the between the two given numbers, starting from the small number to the big number. For negative numbers use brackets when printing the summation
Sample Run1
Enter two numbers: 1 10
Output1: Sum = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55
Sample Run2
Enter two numbers: -3 3
Output2: Sum = (-3) + (-2) + (-1) + 0 + 1 + 2 + 3 = 0