Write Java program which calculator your annual expenses
Let a class Person contains data members name and age. A constructor with two arguments
is used to assign name and age. Person is of two types a) Student and b) Teacher. class
Student contains data members i)course ii) Roll Number and iii)Marks and method
display() to display data related to student. Similarly, class Teacher contains data members
i) subject_assigned (May take this as a String) ii) contact_hour and method display () to
display data related to teacher. Implement this program using base class constructor in
derived class
A point in the x-y plane is represented by its x-coordinate and y-coordinate. Design a class, PointType in Java, that can store and process a point in the x-y plane.Every circle has a center and a radius. Given the radius, we can determine the circle’s area and circumference. Given the center, we can determine its position in the x-y plane. The center of a circle is a point in the x-y plane. Design a class, CircleType that can store the radius and center of the circle. Because the center is a point in the x-y plane and you designed the class to capture the properties of a point from PointType class. You must derive the class CircleType from the class PointType. You should be able to perform the usual operations on a circle, such as setting the radius, printing the radius, calculating and printing the area and circumference, and carrying out the usual operations on the center.
Identify a real-world scenario for the below task:
A task where the next one to work on is always the one that has been waiting the longest.
B. Identify a real-world scenario for the below task:
5
A task where the next one to work on is always the one that has been waiting the longest.
i. For the above task, explain your choice of an appropriate data structure for such a task. [3 marks]
ii. Provide the corresponding algorithm for solving such a problem based on the data structure you chose above. You can represent each step diagrammatically. [5 marks]
C. As the lead system engineer at AIT, you have been given raw data for hundred (100) students who sat for an entrance exam and you have been asked to write the pseudocode to summarize the results. For each student grade, it is written a “P” for pass and “F” for fail.
6
Use indentation and line numbers to highlight the flow of the program:
Your pseudocode should address the following:
i. Prompt the user to enter each result one after the other
ii. Provide a count of the results of each type
iii. Summarize the results indicating the number that passed or failed
A Java developer is asked to write a program that generates a sequence of random bytes for use as a cryptographic key. They search the Java API documentation for pseudorandom number generators and find two classes that could be used for the task: Random and
SecureRandom.
What are the likely differences between these two classes? Why is SecureRandom a better choice that Random?
a) With suitable illustration, discuss the relationship between processes and threads and how a process is created in Windows.
AP,6
b) Using the Windows API, write a C/C++ system program to delete a file in the Windows file system. Compile and run the program and copy the source code into your answer booklet.
CR,8
c) Discuss the Windows registry and how it is use in data/information management. AN,6
C. As the lead system engineer at AIT, you have been given raw data for hundred (100) students who sat for an entrance exam and you have been asked to write the pseudocode to summarize the results. For each student grade, it is written a “P” for pass and “F” for fail. 7 Use indentation and line numbers to highlight the flow of the program: Your pseudocode should address the following: i. Prompt the user to enter each result one after the other ii. Provide a count of the results of each type iii. Summarize the results indicating the number that passed or failed [5 marks] END OF PAPER
B. For larger datasets, a linear search may be inadequate or perhaps inefficient. What other search method can be employed to return the maximum number from a set of elements in an array. Explain your answer. [5 marks]
C. As the lead system engineer at AIT, you have been given raw data for hundred (100) students who sat for an entrance exam and you have been asked to write the pseudocode to summarize the results. For each student grade, it is written a “P” for pass and “F” for fail. Use indentation and line numbers to highlight the flow of the program:
Your pseudocode should address the following:
i. Prompt the user to enter each result one after the other
ii. Provide a count of the results of each type
iii. Summarize the results indicating the number that passed or failed
[5 marks]