Write your own function that illustrates a feature that you learned in this unit. The function must take at least one argument. The function should be your own creation
Write a program that randomly stores 10 integer numbers (to start with) in a LinkedList object. Using this LinkedList object, implement stack and queue operations using GUI as follows: Add 2 Radio Buttons for choosing options (a) Stack and (b) Queue, and 4 JButtons (Push, Pop for Stack, and Add, Delete for Queue).
Write a program which takes PIN number of the user as input and then verifies his pin. If pin is verified the program shall display “pin verified” and “Welcome”; otherwise, the program shall give user another chance. After 4 wrong attempts, the program shall display “Limit expired” and then exit. Use for loops to implement the logic.
Note: 5 random PIN numbers can be assumed and fed into the program with which input pin is matched
Write a program that repeatedly asks the user to enter two money amounts expressed in pounds. The program should then add the two amounts and display the answer in pounds. The program should then convert the amount in Rupees. (Set conversion rate: 1£=120.33 rupees). Display the answer in Naira. Use a do-while loop that asks the user whether the program should be terminated.
Write a program that will perform the following:
A. Display Employee List
(Retrieve records from empList.txt, store it in a dictionary, display the employee list arranged by keys)
Note: Refer to example code in dictionary module (bbl) for sorting
B. Add Employee
(
Ask user to input the following data:
- unique employee number
- lastname
- firstname
- department
- rate per day
Write the employee record to the empList.txt
)
C. Add Payroll Record
(Ask user to input the following data:
-employee number
-month
-no of days worked
write the payroll record into the empMR.txt
)
D. Generate pay slip
Ask for employee number and month of the payslip to be generated
Create a payslip like statement written in a text file.
=============================================================
Payslip for the Month of _________________
Employee No.: ______________ Employee Name: _____________
Department: ________________
Rate per Day:_______________ No. of Days Worked: ________
Gross Pay: _________________
Write a program that does the following for 15 students:
Reads in 3 marks for each student, however, you need to make provision that the user
might be typing invalid values – when an invalid mark is entered, the user should be prompted to re-enter a valid mark. This should happen continuously until you have three valid marks for each student (valid marks are marks between 0 and 100; 0 and 100 included). Your prompt message to the user should indicate which number is being requested
Calculates and displays the highest mark for each student.
Finds and displays the highest mark in the class.
Adapt your code to also read in the name of each student, and add the name to the display
of the highest mark for each student
When displaying the overall highest mark, the name of the relevant student should also be
displayed.
Update your solution to make use of the getMark method. In this updated version, your prompt messages does
not have to indicate which mark is being requested.
3.1. [10 marks] Write a method with the following details:
3.2. [10 marks] Using the method below, write the statements to call the above method with the masses of the earth, moon and the distance between them and display the resulting force.
- Mass of Earth: 5.972E24
- Mass of Moon: 7.348E22
- Distance: 384,400,000 meters
- Answer: 1.99e020N - You should use “E” as a format specifier in your output (like when you use N, F, N2)
Write a user defined method named getMark that can be used to get a valid mark from the user. Your method must continuously ask the user for a mark, until a valid mark is entered (valid marks are between 0 and 100). If a user enters an invalid mark, display an error message before asking for a valid mark to be entered. The method must return the valid value to the calling program.
Write a user defined method named isPass that can be used to determine whether a mark is a pass mark (greater or equal to 50). The method must take as input a mark, and return a boolean, indicating whether the mark was a pass mark.
Write a program that reads in 5 marks by using the getMark method to ensure that valid marks are processed. You need to calculate the sum and the average of the marks. Your program must also use the isPass method to determine the number of pass marks entered. When the 5 marks have been processed you need to display the sum, average and number of passes (from these marks).
Write a program that takes marks of 10 students as input. It calculates the class average and displays it on the screen. Interaction with the program might look like this. Use while loop.
1. [15 marks] Write a new method that will work as the menu of your application. Details:
2. [25 marks] In your Main method, using a “while” loop, not a “do while”, write the code to call the Menu method you have created on question #1 repeatedly.
Using a “switch” structure, write the code to implement the following required functionality for all valid responses. Valid responses includes both upper and lower case of the input. The following must be implemented:
- A will call the DemoQuestion3() method
- B will call the DemoQuestion4() method
- C will call the DemoQuestion5() method
- X will terminate the program
Any other