25 dimes is $2.50 4. Create a Student class definition in your Java package. It must have 4 fields: firstName as string, lastName as string, studentld as string, and GPA as double, and accessor and mutator methods for each field (i.e. setter and getter methods). Hide the fields for accessing from outside of the class, and made them accessible by using the accessor and mutator methods. It must have a constructor to set all 4 fields. Then in your program (which has main method) in your package, calling the Student class constructor, create 3 students: 1 for yourself, 2 for your friends. Then use accessor methods to output student's first name and GPA for all 3 students. Sample console output: A2Vasil12345 [Java Application] Vasil, 78.5. John, 80.2 Elen, 81.25 5. In a program you need to store the populations of 5 cities of Canada (search on Internet any 5 Canadian cities and their population or make up this information yourself). a. Define two arrays that may be used in parallel to store the names of the cities and their populations. b. Write a loop that uses these arrays to print each city's name and its population. Sample console output:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Java programming Question 4
d to this PC-
Search (Alt+Q)
ailings Review View Help
Unless you need to edit, it's safer to stay in Protected View.
10 dimes is $1.00
12 dimes is $1.20
25 dimes is $2.50
Enable Editing
4. Create a Student class definition in your Java package. It must have 4 fields: firstName as string,
lastName as string, studentld as string, and GPA as double, and accessor and mutator methods for
each field (i.e. setter and getter methods). Hide the fields for accessing from outside of the class, and
made them accessible by using the accessor and mutator methods. It must have a constructor to set
all 4 fields. Then in your program (which has main method) in your package, calling the Student class
constructor, create 3 students: 1 for yourself, 2 for your friends. Then use accessor methods to output
student's first name and GPA for all 3 students.
Sample console output:
<terminated> A2Vasil12345 [Java Application]
Vasil, 78.5
John, 80.2
Elen, 81.25
5. In a program you need to store the populations of 5 cities of Canada (search on Internet any 5
Canadian cities and their population or make up this information yourself).
a. Define two arrays that may be used in parallel to store the names of the cities and their
populations.
b. Write a loop that uses these arrays to print each city's name and its population.
Sample console output:
DELL
O
Transcribed Image Text:d to this PC- Search (Alt+Q) ailings Review View Help Unless you need to edit, it's safer to stay in Protected View. 10 dimes is $1.00 12 dimes is $1.20 25 dimes is $2.50 Enable Editing 4. Create a Student class definition in your Java package. It must have 4 fields: firstName as string, lastName as string, studentld as string, and GPA as double, and accessor and mutator methods for each field (i.e. setter and getter methods). Hide the fields for accessing from outside of the class, and made them accessible by using the accessor and mutator methods. It must have a constructor to set all 4 fields. Then in your program (which has main method) in your package, calling the Student class constructor, create 3 students: 1 for yourself, 2 for your friends. Then use accessor methods to output student's first name and GPA for all 3 students. Sample console output: <terminated> A2Vasil12345 [Java Application] Vasil, 78.5 John, 80.2 Elen, 81.25 5. In a program you need to store the populations of 5 cities of Canada (search on Internet any 5 Canadian cities and their population or make up this information yourself). a. Define two arrays that may be used in parallel to store the names of the cities and their populations. b. Write a loop that uses these arrays to print each city's name and its population. Sample console output: DELL O
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY