Implement a class person with two fields name

Assignment Help JAVA Programming
Reference no: EM13696586

You need to implement a class that saves the details of the person.       

Question: Implement a class Person with two fields name and age, and a class Car with three fields:

  • The model
  • A pointer to the owner (a Person*)
  • A pointer to the driver (also a Person*)

Program: Write a program that prompts the user to specify people and cars. Store them in a vector<Person*> and a vector<Car*>.

Traverse the vector of Person objects and increment their ages by one year.

Traverse the vector of cars and print out the car model, owner's name and age, and driver's name and age.

Reference no: EM13696586

Questions Cloud

Determine maximum current magnitude allowed by device : The voltage across a two terminal device is always 15.0 V. The maximum power the device can dissipate is 0.87 W - Determine the maximum current magnitude allowed by the device power rating.
Write program that uses a class named rectangle : Write program that uses a class named Rectangle. The class has floating point attributes length and width. it has member functions that calculate the perimeter and area of the rectangle. It also has set and get functions for both length and width.
Create a 2-dimensional array for the volume of concrete : Your Company constructs concrete hemispherical domes that range in diameter from 40 to 90 feet and increments of 5 feet.
Write a matlab code using for loop : Write a MATLAB code using "for" loop to compute y when n = 50,100 and 1000.
Implement a class person with two fields name : Implement a class Person with two fields name and age, and a class Car with three fields - implement a class that saves the details of the person.
Create a program that counts the number of numbers : you need to create a program that counts the number of numbers between 150 and 200 - Can you write this program in c language? You need to implement a function that counts the numbers.
Difference between these two ways of initializing variables : What is the difference between these two ways of initializing variables - Can you explain this question and show the difference between the ways of initializing variables?
Write a marie program : Write a Marie program - Given a numbers in memory, labelled V, reverse its sign - You can halt your program once the Result is determined.
Different types of digital modulation schemes : How can we compare the performance of two or more different types of digital modulation schemes?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Graphical application for computing statistics

Write a graphical application for computing statistics of a data set. Supply a text field and button for adding floating-point values, and display the current minimum, maximum, and average in a label.

  Determine whether the five-digit input was odd or even

inputs one number consisting of five digits from the user, separates the number into its individual digits and prints the digits separated from one another by three spaces each.

  Program that counts the number of occurrences of lowercase

Write a program that counts the number of occurrences of lowercase and uppercase vowels in entered lines of text. Use a two-dimensional array to store the vowel counts. The array's first column holds the counts for the lowercase vowels, and the secon..

  Discuss factors that affect sorting in sediment

Discuss factors that affect sorting in sediment. How could one tell the latitude at which a sediment was originally deposited? Compare and contrast phosphate and manganese nodules.

  Method called wordlengths that accepts a scanner

Write a method called wordLengths that accepts a Scanner representing an input file as its argument. Your method should read from the given file.

  Write a program that takes as input student scores

Write a program that takes as input student scores from a file and outputs the average for each student to a file.

  Prepare a basic code to do the followingwrite a program

prepare a basic code to do the following.write a program that shows the current time and date evaluated from the

  Create java applet to represent grade of gas

Write a java applet (not a java application program) for costco gas station. The applet will first ask you whether you are a costco customer, then the grade of gas you want to use.

  Write a java program in a netbeans project that reads a

write a java program in a netbeans project that reads a text file containing the names and addresses of several people

  Find method of the class is passed each of the targets

How many calls to the recFind method of the ArraySortedList3 class are made when the find method of the class is passed each of the targets?

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd