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
ludmilkaskok [199]
3 years ago
13

Given a class called Measure that has the methods and data as specified, choose the correct code to satisfy the requirements of

the class.
public class Measure implements Comparable

{

//Instance variables yards, feet, inches;

//Constructors (default and overloaded)

//Accessors for yards, feet, and inches

//Mutators for yards, feet, and inches


//totalInches returns an int of the total inches for the current object

//toString returns a string in the form: 6 yards, 2 feet, and 5 inches

//Adding 2 measure objects (current object and one passed in as a parameter)

//addMeasure returns a measure object that is the sum of two measure objects,

// the current object and one that is passed in as a parameter

}

Which of the following would be the correct implementation for the method totalInches that returns an int of the total inches for the current object in the measured class? (36 inches = 1 yard)

A. return 36 * feet + 12 * yards + inches;
B. System.out.println(36 * yards + 12 * feet + inches);
C. int total = 36 * yards + 12 * feet + inches;
return total;
D. none of these
Computers and Technology
1 answer:
Nina [5.8K]3 years ago
7 0

Answer:

D

Explanation:

You might be interested in
What are some of the general components of an IDE?
AysviL [449]

Answer:

An IDE normally consists of a source e editor, build automation tools. Most modern IDEs have intelligent code completion. Some IDEs contain a compiler, interpreter, or both.

5 0
3 years ago
Part1) Given 3 integers, output their average and their product, using integer arithmetic.
Mrac [35]

Answer:

The program is as follows:

#include <iostream>

#include <iomanip>

using namespace std;

int main(){

   int num1, num2, num3;

   cin>>num1>>num2>>num3;

   cout << fixed << setprecision(2);

   cout<<(num1 + num2 + num3)/3<<" ";

   cout<<num1 * num2 * num3<<" ";

   return 0;

}

Explanation:

This declares three integer variables

   int num1, num2, num3;

This gets input for the three integers

   cin>>num1>>num2>>num3;

This is used to set the precision to 2

   cout << fixed << setprecision(2);

This prints the average

   cout<<(num1 + num2 + num3)/3<<" ";

This prints the product

   cout<<num1 * num2 * num3<<" ";

6 0
3 years ago
All of the following can cause a fatal execution-time error except: Group of answer choices Dereferencing a pointer that has not
7nadin3 [17]

Answer: Dereferencing a variable that is not a pointer

Explanation:

The execution time also refered to as the CPU time pertaining to a given task is the time that is used by the system to execute a task.

Some of the reasons for a fatal execution-time error include:

• Dereferencing a pointer that has not been initialized properly

• Dereferencing a null pointer

• Dereferencing a pointer that has not been assigned to point to a specific address.

It should be noted that dereferencing a variable that is not a pointer doesn't cause a fatal execution-time error.

6 0
2 years ago
Sam's manager would like him to create and distribute copies of a budget report for each department. The budget report should sh
almond37 [142]
<span>a spreadsheet and a printer</span>
7 0
3 years ago
Read 2 more answers
The type of connection that is kept open after an HTTP request to the server.
Igoryamba

Answer: Persistent

Explanation:

 Persistent is the type of connection in the hyper text transfer protocol (HTTP) that act as communication channel in the network. It basically remain open after HTTP request or response to the server.

Persistent also maintain the HTTP connection and prevent it from the timing out with the help of transmission control protocol packets.

In the persistent connection, after request has been send TCP connection is leave by the server. Therefore, the request can be easily send between the similar server and client.

6 0
3 years ago
Other questions:
  • There is a simple method for constructing a magic square for any odd value of n:
    15·1 answer
  • Consider ________ when designing for display on a mobile device. font size all of these contrast small screen size
    8·2 answers
  • What port is typically reserved and utilized by the Secure Hypertext Transfer Protocol to create a secure connection to a Web se
    13·1 answer
  • What is the trickiest time of the day to drive? A. Early morning B. Late night C. After the sun sets
    8·2 answers
  • In the digital age we have less time to absorb and make sense of new information
    12·2 answers
  • How are satellite radio, Internet radio, and podcasting different?
    11·1 answer
  • Which plan includes procedures and processes that ensure the smooth functioning of the business even after a disaster?
    14·2 answers
  • In what way can a costume be deleted ?
    13·1 answer
  • A(n) ________ will clear all user data and setting changes, returning the device's software to the state it was in when it left
    6·1 answer
  • Explain briefly how learning how to follow can make a person a good leader
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!