Write a tester program to test the mobile class defined below. Create the class named with your id (use : Id 190099306) with the main method.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

Write a tester program to test the mobile class defined below.

Create the class named with your id (use : Id 190099306) with the main method.

  1. Create two mobiles M1 and M2 using the first constructor.
  2. Print the characteristics of M1 and M2.
  3. Create one mobile M3 using the second constructor.
  4. Change the id and brand of the mobile M3. Print the id of M3.

Your answer should include a screenshot of the output. 

public class Mobile {

  private int id;

  private String brand;

 

public Mobile() {

    id = 0;

    brand = "";

  }

 

public Mobile(int n, String name) {

    id = n;

    brand = name;

  }

 

public void setBrand(String w) {

    brand = w;

  }

 

public void setId(int w) {

    id = w;

  }

 

Public int getId() {

return id;

  }

 

public String getBrand() {

return brand;

  }

 

}

please provide me how to do the steps and i will try to work it alone. we didn't study this excersie in the lab 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Software Development
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT