Question
modify according to the instruction in jgrasp The Person Program see Instructions for modifications of this program below. class Person { //Instance variables (data or
modify according to the instruction in jgrasp The Person Program see Instructions for modifications of this program below. class Person { //Instance variables (data or "state") String name; int age; // Classes can contain // 1. Data // 2. Subroutines (called methods in Java void speak() { System.out.println("Hello"); System.out.println("My name is: " +name +" and I am " +age + " years old"); } } public class App { public static void main(String[] args) { // Create a Person object using the person class Person person1 = new Person(); person1.name = "Joe Bloggs"; person1.age = 37; person1.speak(); // Create a second Person object Person person2 = new Person(); person2.name = "Sarah Smith"; person2.age = 20; System.out.println(person1.name); } }
Instructions a. Create a third (3rd) person object and give them a name and age.
b. Create a city where each person lives
c. Create Savings Account balance for each person. Make sure it shows dollars and cents; it is not necessary to use the $ for currency.
d. Create a write method (a behavior) that each person is capable of carrying out.
e. Have person3 who has commitment issues write the poem Roses on p. 64 of your text in the format specified in the text..
f. Write a method for counting and have person1 count from 1 to 5, three times.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started