1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aev [14]
3 years ago
11

Write a second constructor as indicated. Sample output:User1: Minutes: 0, Messages: 0User2: Minutes: 1000, Messages: 5000// ====

= Code from file PhonePlan.java =====public class PhonePlan { private int freeMinutes; private int freeMessages; public PhonePlan() { freeMinutes = 0; freeMessages = 0; } // FIXME: Create a second constructor with numMinutes and numMessages parameters. /* Your solution goes here */ public void print() { System.out.println("Minutes: " + freeMinutes + ", Messages: " + freeMessages); return; }}
Computers and Technology
1 answer:
-BARSIC- [3]3 years ago
8 0

Answer:

The code to this question can be given as:

Second constructor code:

PhonePlan(int min,int messages) //define parameterized constructor and pass integer variables.

{  

freeMinutes = min;   //variable holds value of parameter.  

freeMessages = messages;  //variable holds value of parameter.

}

Explanation:

In the question, It is given that write a second constructor. So, the code for this question is given above that can be described as:

  • In this code, we define a parameterized constructor that is "PhonePlan()". In this constructor, we pass two integer variable that is min and message. The constructor name same as the class name and it does not return any value.  
  • In this constructor, we use the variable that is defined in the PhonePlan class which is "freeMinutes and freeMessages". This variable is used for holding the parameter variable value.

 

You might be interested in
Why might you use a navigation form instead of tab pages? The navigation form allows for several levels and sublevels to be coll
boyakko [2]

Answer:

Access includes a Navigation Control that makes it easy to switch between various forms and reports in your database. A navigation form is simply a form that contains a Navigation Control. Navigation forms are a great addition to any desktop database.

Explanation:

yes

3 0
3 years ago
Read 2 more answers
What would you use to see what network adapters are installed in your windows computer?
Lesechka [4]
I wouldn't see anything, because my computer does not use any network adaptors.
6 0
3 years ago
u arrive at an intersection with traffic lights that are not working because of a power outage. What do you do?
maxonik [38]
Go to o rilles or autozone
5 0
4 years ago
Write a statement that reads 5 successive integers into these variables that have already been declared: x1, x2, x3, x4, x5. The
prisoha [69]

Answer:

Following are the statement in C++ language :

#include <iomanip> // header file  

using namespace std; // namespace

int main() // main method  

{

   int x1,x2,x3,x4,x5; // variable declaration

cout<<" Enter the 5 sucessive integer:";

cin>>x1>>x2>>x3>>x4>> x5; // taking 5 input from user

cout<<right;

// prints each  of  its own line and form a right-justified  

cout<<setw(5)<< x1 << "\n" << setw(5) << x2 << "\n" <<setw(5) << x3 << "\n" << setw(5) << x4 << "\n" << setw(5) << x5 << "\n";

return(0);    

}

Output:

Enter the 5 sucessive integer: 45

23

445

6

8

 

  45

  23

 445

   6

   8

Explanation:

Description of program is given below  

  • Declared a 5 integer value x1,x2,x3,x4,x5 respectively.
  • Read the 5 integer value from user by using cin funtion.
  • Finally Print these 5 value in its own line and form a right-justified by using setw() function on it
5 0
3 years ago
careful driving requires the appropriate Reaction Time both simple and complex breaking and then shifting gears followed by sign
arlik [135]

The examples listed all belong in the category of complex reaction time.

6 0
3 years ago
Other questions:
  • What type of stud is placed below a windowsill to support its weight
    12·1 answer
  • Which opera component is a solo performance
    10·2 answers
  • A company uses DHCP servers to dynamically assign IPv4 addresses to workstations. The address lease duration is set as 5 days. A
    6·1 answer
  • If you reset your iPhone will it delete everything including your Apple ID information
    9·2 answers
  • Typically, the first item in defining a function is _____. (Points : 4)
    6·1 answer
  • In which type of modulation is a 1 distinguished from a 0 by shifting the direction in whichthe wave begins?
    14·1 answer
  • What language below is used to view and manipulate data that is stored in a relational database?
    6·1 answer
  • Six external parts of a computer system
    13·1 answer
  • ____coping skills are instinctive.<br> A. All<br> B. No<br> C. Some
    9·1 answer
  • How has the dependence on technology made humanity less intelligent?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!