Edit and complete this linked list code to ASK and DISPLAY, how many members, 1st, middle, lastname, area code, tel number, gender, age
import java.io.*;
public class FinalNode {
public int data;
public FinalNode next;
public static FinalNode firstNode;
public static FinalNode lastNode=null;
public FinalNode(int d,FinalNode n)
{
data=d;
next=n;
}
public static void main(String[] args) throws IOException{
int numnodes, num;
BufferedReader s= new BufferedReader(new InputStreamReader(System.in));
System.out.print("How many nodes to input? ");
numnodes = Integer.parseInt(s.readLine());
for(int i=0;i<numnodes;i++){
System.out.print("Enter node"+(i+1)+":");
num = Integer.parseInt(s.readLine());
FinalNode n =new FinalNode(num, null);
if(lastNode!=null)
{
lastNode.next=n;
lastNode=n;
}
else
{
firstNode=n;
lastNode=n;
}
}
System.out.print("entered nodes: ");
FinalNode n=firstNode;
while(n!=null)
{
System.out.print(n.data+"\t");
n=n.next;
}
System.out.println();
}
}
Java is known to be an object oriented program. Objects are also known to exist in real life. You have been invited as a computer science student to distinguish between real life objects and object found in object oriented program OOP (5 marks) b. Write an OOP to compare the risk factor that will lead to high payment of life insurance premium. The variables to consider are: age, weight, and height
Write an application that allows a user to enter any number of student test scores until the user enters 999. If the score entered is less than 0 or more than 100, display an appropriate message and do not use the score. After all the scores have been entered, display the number of scores entered, the highest score, the lowest score, and the arithmetic average.
java create a program that asks the user for the number of male and female students registered in a class/section. the program should display the total number of students and the percentage of males and females in the class
Create a class “Calculator” with two variables, a constructor with no parameter and two functions for add and multiply. Create a class TestApp with a main function and create object of Calculator class to call functions.
Create a class Calculator with two variables, a constructor with no parameter and
two functions for add and multiply. Add functionality for overloading sum and
multiply. Also call scientific functions using Math class (sine, cos, tan and power).
Create a class TestApp with a main function and create object of Calculator class to
call functions.
Create a class “Calculator” with two variables, a constructor with no parameter and
two functions for add and multiply. Create a class TestApp with a main function and
create object of Calculator class to call functions.
Use linked list,
Accept information first name
middle name last name area code telephone number gender and age. Display information of each member.
give info for member #1
Enter first name: Ta
Enter middle name: Ma
Enter last name: Ta
Enter area code: 047
Enter telephone number: 1-22
Enter gender: male
Enter age: 21
Give information of member #2
Enter first name: Ja
Enter middle name: La
Enter last name: Ga
Enter area code: 047
Enter telephone number: 2-33
Enter gender: female
Enter age: 18
//display
Welcome to the club Ta Ma Ta!
Your area code and telephone number is (047) 1-22.
You are a male member, and your age is 21.
Welcome to the club Ja La Ga!
Your area code and telephone number are (047) 2-33.
You are a female member, and your age is 18.
On the form create a list box, to allow a user to select between three different cities. Also create a combo box for the user to select the year. Finally add a submit button. Once the user has selected a city, year and clicked the submit button display the petrol price per litre for that year.
Use the following table for the city and yearly petrol prices per litre:
2017 2018 2019
Johannesburg 10.72 10.35 10.20
Durban 12.75 12.32 12.22
Cape Town 13.70 13.31 13.23
You are also required to create a menu system which will allow the user to exit the application under the file menu. Under the tools menu allow the form submission and option to display the average yearly petrol price report. The layout of the form is left to your discretion. Marks will be allocated to the presentation and effectiveness of the layout, but the following layout is displayed for your convenience
On the form create two combo boxes, one for the country selection and another to select a town. Also, add two radio buttons for the user to select to display either a phone or postal code.
You are also required to create a menu system which will allow the user to exit the application under the file menu. Under the tools menu allow the form submission and option to display the average yearly petrol price report. The layout of the form is left to your discretion. Marks will be allocated to the presentation and effectiveness of the layout, but the following layout is displayed for your convenience.
SOUTH AFRICA UNITED KINGDOM
Cape Town London
Phone Code: 021 Phone Code: 020
Postal Code: 8000 Postal Code: WC2N5DU
Johannesburg Oxford
Phone Code: 011 Phone Code: 01865
Postal Code: 2000 Postal Code: OX13PN
Durban Southampton
Phone Code: 031 Phone Code: 023
Postal Code: 4000 Postal Code: SO147DW