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
Margarita [4]
3 years ago
8

1. Create a constructor definition that has two parameters, a manufacturer’s brand and a screen size. These parameters will brin

g in information. 2. Inside the constructor, assign the values taken in from the parameters to the corresponding fields. 3. Initialize the powerOn field to false (power is off), the volume to 20, and the channel to 2. 4. Write comments describing the purpose of the constructor above the method header. 5. Compile and debug. Do not run. Task #3 Methods 1. Define accessor methods called getVolume, getChannel, getManufacturer, and getScreenSize that return the value of the corresponding field. 2. Define a mutator method called setChannel accepts a value to be stored in the channel field. 3. Define a mutator method called power that changes the state from true to false or from false to true. This can be accomplished by using the NOT operator (!). If the boolean variable powerOn is true, then !powerOn is false and vice versa. Use the assignment statement powerOn = !powerOn; to change the state of powerOn and then store it back into powerOn (remember assignment statements evaluate the right hand side first, then assign the result to the left hand side variable. 4. Define two mutator methods to change the volume. One method should be called increaseVolume and will increase the volume by 1. The other method should be called decreaseVolume and will decrease the volume by 1. 5. Write javadoc comments above each method header. 6. Compile and debug. Do not run.
Computers and Technology
1 answer:
katen-ka-za [31]3 years ago
3 0

Answer:

C++.

Explanation:

#include <iostream>

#include <string>

using namespace std;

////////////////////////////////////////////////////////////

class Television {

   string brand;

   float screen_size;

   bool powerOn;

   int volume;

   int channel;

   

public:

   // Comments

   Television(string brand, int screen_size) {

       this->brand = brand;

       this->screen_size = screen_size;

       powerOn = false;

       volume = 20;

       channel = 2;

   }

   //////////////////////////////////////////

   // Comments

   int getVolume() {

       return volume;

   }

   

   // Comments

   int getChannel() {

       return channel;

   }

   

   // Comments

   string getManufacturer() {

       return brand;

   }

   

   // Comments

   float getScreenSize() {

       screen_size;

   }

   ///////////////////////////////////////////

   // Comments

   void setChannel(int channel) {

       this->channel = channel;

   }

   

   // Comments

   void power() {

       if (!powerOn)

           powerOn = !powerOn;

   }

   

   // Comments

   void increaseVolume() {

       volume = volume + 1;

   }

   

   // Comments

   void decreseVolume() {

       volume = volume - 1;

   }

};

You might be interested in
A technician is using a network-attached desktop computer with a Type 2 hypervisor to run two VMs. One of the VMs is infected wi
lianna [129]

Answer:

Place both VMs on virtual NICs that are isolated from the company LAN.

Explanation:

From the scenario above, for the technician to best protect the company's LAN while performing the above mentioned tests, it us best to place both VMs on virtual NICs that are isolated from the company LAN.

Cheers

4 0
3 years ago
Question: 4/8
Gemiola [76]

The generated test cases for the function assuming another developer coded the function is given below in a C++ program.

<h3>THE CODE</h3>

#include <iostream>  

#include <iomanip>

#include <string>

using namespace std;

// define the data type "triangletype" with {values}

enum triangleType { scalene, isosceles, equilateral, noTriangle };

// Prototype function which returns the position of triangleType{value}

// Example: Scalene = 0, isosceles = 1, etc. These are zero indexed.

triangleType triangleShape(double a, double b, double c);

// Prototype function which takes the integer value of the

// triangle type and outputs the name of triangle

string shapeAnswer(int value);

int main() {

   double inputA;

   double inputB;

   double inputC;

   cout << "To determine whether a triangle is either:" << endl;

   cout << setw(50) << " - Scalene" << endl; // Unequal in length

   cout << setw(52) << " - Isosceles" << endl; // Two sides equal length

   cout << setw(54) << " - Equilateral" << endl; // All sides equal

   cout << setw(57) << " - Not a triangle" << endl;

   cout << "Enter side A: ";

   cin >> inputA;

   cout << "Enter side B: ";

   cin >> inputB;

  cout << "Enter side C: ";

   cin >> inputC;

   cout << "The triangle is " << shapeAnswer(triangleShape(inputA, inputB, inputC)) << endl;

}

triangleType triangleShape(double a, double b, double c) {

   triangleType answer;

   if ( c >= (a + b) || b >= (a + c) || a >= (b + c) ) {

       answer = noTriangle;

   }

   else if (a == b && b == c) {

       answer = equilateral;

   }

   // Test the 3 options for Isosceles equality

   else if ( (a == b) && (a != c) || (b == c) && (b != a) || (a == c) && (a != b) ) {

       answer = isosceles;

   }

   else {

       answer = scalene;

   }

   return answer;

}

string shapeAnswer(int value) {

   string answer;

  switch (value) {

   case 0:

       answer = "Scalene";

       break;

   case 1:

       answer = "Isosceles";

       break;

   case 2:

       answer = "Equilateral";

       break;

   case 3:

       answer = "Not a triangle";

       break;

   default:

       break;

   }

   return answer;

}

Read more about C++ programs here:

brainly.com/question/20339175

#SPJ1

8 0
1 year ago
Electronic résumés have an attractive, highly formatted appearance. please select the best answer from the choices provided t f
Len [333]

An electronic resume can carry so much data about the person, and it includes images also. Then the statement is true.

<h3>What is an electronic resume?</h3>

An electronic resume is termed as a resume that is read by a computer program that summarizes the information of each person.

The electronic resume has the data such as their parent name, education, skills, job experience, hobbies, languages, and so on.

Thus, the photo of the document about the project or internship that has been done in the past can be given on the electronic resume by uploading the certificate on the computer system along with the resume.

For example, in companies like Linkedin, and so on there are many companies that ask about the person before creating an account.

More about the electronic resume link is given below.

brainly.com/question/2798964

4 0
2 years ago
Read 2 more answers
How would you describe the difference between a syntax error and a logic error?
Ugo [173]

Answer:

hii

Explanation

syntax error:  a syntax error is an error in the syntax of a sequence of characters or tokens that is intended to be written in compile-time. A program will not compile until all syntax errors are corrected.

logic error:  logic error is a bug in a program that causes it to operate incorrectly, but not to terminate abnormally. A logic error produces unintended or undesired output or other behaviour, although it may not immediately be recognized as such.

6 0
2 years ago
Read 2 more answers
1. What does a network allow computers to share?
Veronika [31]

Answer:

1. B 2. D

Explanation:

If computers share processing power, it is just a larger computer.

8 0
3 years ago
Other questions:
  • 1. An Excel file is called a workbook?<br> A) True<br> B) False
    6·2 answers
  • Is anyone else experiencing the wording::nonifacation::glitch about the "5 hours ago" thingy to whenever you answer a question o
    7·2 answers
  • Which of the following are examples of algorithms? (Select all that apply, if any do.)
    15·2 answers
  • Mr. Green maintains a spreadsheet containing data on all of his employees, including name, job profile, monthly salary, and home
    15·1 answer
  • Use the RSA cipher with public key n = 713 = 23 · 31 and e = 43. Encode the word "KING" into its numeric equivalent and encrypt
    15·1 answer
  • Employers will check you out on social media sites like Facebook, MySpace, and Twitter.
    6·2 answers
  • As a ______________ you must be able to show that you know what to do to keep food safe
    15·1 answer
  • If you were infiltrating a network (10.16.0.0/16), and searching for vulnerabilities (while trying to remain undetected), why wo
    11·2 answers
  • What is output by the following line of code?
    15·1 answer
  • ____must cooperate with each other to neutralize the global threat of information censorship. Select 3 options.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!