answer.
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
Jobisdone [24]
2 years ago
8

Write the definition of a class Telephone. The class has no constructors, one instance variable of type String called number, an

d two static variables. One is of type int called quantity; the other is of type double called total. Besides that, the class has one static method makeFullNumber. The method accepts two arguments, a String containing a telephone number and an int containing an area code.
Computers and Technology
1 answer:
svp [43]2 years ago
7 0

Answer:

public class Telephone

{

private String number;

private static int quantity;

private static double total;

public static String makeFullNumber(String phoneNum, int areaCode)

{  return(areaCode + "-" + phoneNum);  }

}

Explanation:

The class name is Telephone.

It has one instance variable named number.

It contains two static variables. static variables belongs to the class Telephone and these are initialized only once and shared among all of Telephone class objects.

The static variable quantity is of data type int which accepts integer values.

The static variable total is of data type double which accepts real values.

The class has static method makeFullNumber. This method has two parameters phoneNum and areaCode. The function returns the area code followed by telephone number and they both are separated by dash "-".

You might be interested in
Write a cout statement that prints the value of a conditional expression. The conditional expression should determine whether th
MissTica

Answer:

The explanation to this question is given below in the explanation section.

Explanation:

#include <iostream>

#include <string>

using namespace std;

int main()

{

   int score;

   cout << "Enter Score: \n";

   cin>>score;

   if (score == 100)

//whether the value of the score variable is equal to 100

   {

       cout << "Perfect ";

//If so, it should print “Perfect”

   }

   else

   {

       cout << "Nice Try ";  

   }

 

}

     

     

7 0
2 years ago
Please can someone help me answer this question.
Westkost [7]

Answer:

Upload an image to help people

ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ

7 0
2 years ago
Which of the following is an object such as a field which can be inserted into a document
ivanzaharov [21]

Answer:

SORRY but U have to make a new question.

Explanation:

bc u put which is the following is ..... u did not put the following

cant help on this one.

8 0
2 years ago
The ratio of Chris an iood Dom's ages is
irinina [24]

Answer:

28 years

Explanation:

Let's represent present age of Chris and Dom as C and D respectively. Then since ratio of present age of Chris and Dom is 3:4. Therefore,

\frac{C}{D}=\frac{3}{4}

C=\frac{3}{4}D   ...(1)

Now, it is given that in 7 years their age ratio will become 4:5. Therefore,

\frac{C+7}{D+7}=\frac{4}{5}

5C+35=4D+28\\

Using value of C from equation(1),

5\times\frac{3}{4}D-4D=28-35

15D-16D=-28\\-D=-28\\ D=28

Thus, present age of Dom is 28 years.

8 0
3 years ago
Check your tire pressure every _____. A. month B. two months C. six months D. year
ohaa [14]

Answer: I'd say (B) Two months

Explanation: Hope its correct and helps, Good luck :)

6 0
2 years ago
Read 2 more answers
Other questions:
  • Exercise 6.3 consider memory storage of a 32-bit word stored at memory word 42 in a byte-addressable memory. (a) what is the byt
    14·1 answer
  • Using the RAID controller on the motherboard, you configure three hard disks in a RAID 5 array. You leave the array unpartitione
    14·1 answer
  • Consider the following classes:
    8·1 answer
  • Your friend Margo is considering what type of display to purchase with her new desktop computer and she asks you for advice. You
    14·1 answer
  • Write a program that lets a user enter N and that outputs N! (N factorial, meaning N*(N-1)*(N-2)*..\.\*2*1). Hint: Initialize a
    5·1 answer
  • If productCost and productPrice are numeric variables, and productName is a string variable, which of the following statements a
    11·1 answer
  • Longer speeches should be separated into the paragraphs of:
    9·1 answer
  • JAVA...Write a statement that calls the recursive method backwardsAlphabet() with parameter startingLetter.
    9·1 answer
  • Animated graphics that are displayed on the screen after a set of time when the computer is unattended.​
    8·1 answer
  • Choose the response that best completes the following statement.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!