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
Verdich [7]
2 years ago
6

Temperature Class Write a Temperature class that will hold a temperature in Fahrenheit and provide methods to get the temperatur

e in Fahrenheit, Celsius, and Kelvin. The class should have the following field: ftemp. A double that holds a Fahrenheit temperature. The class should have the following methods: Constructor. The constructor accepts a Fahrenheit temperature (as a double) and stores it in the ftemp field. setFahrenheit. The setFahrenheit method accepts a Fahrenheit temperature (as a double) and stores it in the ftemp field. getFahrenheit. Returns the value of the ftemp field, as a Fahrenheit temperature (no conversion required). getCelsius. Returns the value of the ftemp field converted to Celsius. getKelvin. Returns the value of the ftemp field converted to Kelvin.
Computers and Technology
1 answer:
posledela2 years ago
8 0

Answer:

Explanation:

   public class Temperature

   {

       double ftemp;

       public int Constructor(double fahrenheit)

       {

           ftemp = fahrenheit;

          return Convert.ToInt32(ftemp);

       }

       public void setFahrenheit(double fahrenheit)

       {

           ftemp = fahrenheit;

       }

       public void getFahrenheit()

       {

           ftemp = Constructor(ftemp);

       }

       public void getCelcius()

       {

           ftemp = (ftemp - 32) * 5 / 9;

       }

       public void getKelvin()

       {

           ftemp = (ftemp - 32) * 5 / 9 + 273.15;

       }

   }

You might be interested in
When a typeface does not have any extra embellishments on the top and bottom of the letterforms, it is called a ________ font?
Harrizon [31]

The font that does not have extra embellishment, as well as its top and bottom of the letter forms is the sans serif. This font does not provide any features that are extended and that they are comprised of less line width.

5 0
1 year ago
Modern operating system decouple a process address space from the machine's physical memory. list two advantages of this design.
likoan [24]

The two advantages of modern operating systems is that it has the capacity in helping programs to be loaded faster compared to other older versions and it also has the ability of having to run programs that are large enough in which is in the main memory even if it is smaller compared to the size of its program.

4 0
2 years ago
Match common encryption algorithms and methods with the scenarios representing real-world business applications and requirements
Sladkaya [172]

The question is incomplete as the scenarios are not given that were to be matched by the given encryption algorithms.

By finding the question from internet i have attached the image of the scenarios in the form of table and answered below accordingly

<h2>Answer:</h2>

<u>Scenario A:</u>

Advanced Encryption Standard (AES) is a technique that uses 256-bit cipher texts for encryption process. The data encrypted by AES cannot be attacked and even it cannot be decrypted unless a brute-force search is used through all of possible 256-bit keys.For mobile security it is known as one of the best algorithms.

<u>Scenario B:</u>

Following are the techniques of encryption used for given scenario:

  • ECC
  • Digital Signature
  • AES
  • Blowfish

<u>Scenario C:</u>

Following are the techniques of encryption used for given scenario:

  • ECC
  • Blowfish

<u>Scenario D:</u>

Secure Sockets Layer (SSL) - SSL is a protocol that is commonly-used for managment of the message transmission security over the Internet)

<u>Scenario E:</u>

Advanced Encryption Standard (AES) - AES is an encryption algorithm used by U.S. Government agencies for securing sensitive but unclassified material .

i hope it will help you!

5 0
1 year ago
You would like the user of a program to enter a customer’s last name. Write a statement thaUse the variables k, d, and s so that
mojhsa [17]

Answer:

1st question:

Use the variables k, d, and s so that they can read three different values from standard input an integer, a float, and a string respectively. On one line, print these variables in reverse order with exactly one space in between each. On a second line, print them in the original order with one space in between them.

Solution:

In Python:

k = input()  #prompts user to input value of k i.e. integer value

d = input()  #prompts user to input value of d i.e. float value

s = input()  #prompts user to input value of s i.e. a string

print (s, d, k)  #displays these variable values in reverse order

print (k, d, s)#displays these variable values in original order

In C++:

#include <iostream>    // to use input output functions

using namespace std;   //to identify objects like cin cout

int main() {    //start of main function

  int k;   //declare int type variable to store an integer value

  float d; //  declare float type variable to store a float value

  string s;   //  declare string type variable to store an integer value

  cin >> k >> d >> s;    //reads the value of k, d and s

  cout << s << " " << d << " " << k << endl;     //displays these variables values in reverse order

  cout << k << " " << d << " " << s << endl;   } // displays these variable values in original order

Explanation:

2nd question:

You would like the user of a program to enter a customer’s last name. Write a statement that asks user "Last Name:" and assigns input to a string variable called last_name.

Solution:

In Python:

last_name = input("Last Name:")

# input function is used to accept input from user and assign the input value to last_name variable

In C++:

string last_name;  //declares a string type variable named last_name

cout<<"Last Name: ";  // prompts user to enter last name by displaying this message Last Name:

cin>>last_name; // reads and assigns the input value to string variable last_name

The programs alongwith their outputs are attached.

6 0
2 years ago
Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off. The follow
Dafna11 [192]

Answer:

1)

officeAC = new AirConditioner();

officeAC.turnOn();

2)

officeAC = new AirConditioner();

officeAC.turnOn();

officeAC.setTemp(69);  

Explanation:

1)

In the first statement a new object of the class AirConditioner whose reference is assigned to the officeAC. new is a keyword which creates an object of the class.

Next statement uses the method turnOn(). Reference to the new object officeAC is used to invoke this method turnOn().

2) The first two statements works the same as in 1)

The last statement invokes a method setTemp() using the reference variable and passes the value 69 to this method to set the desired temperature.

6 0
1 year ago
Other questions:
  • Which act was used to penalize Sara? Sara was found to be in possession of a controlled substance for which she had no justifica
    5·1 answer
  • James is an employee at the packaging unit of a chocolate factory that has come up with a new concept of packaging and marketing
    11·2 answers
  • Our new catalog contains an eclectic collection of items
    6·1 answer
  • 15) The codes for class Hotel has been defined in two separate files Hotel.h, and Hotel.cpp. Which of the following statements i
    12·1 answer
  • Read the four detective reports and the combined affidavit and warrant for the M57 Patents case. Write a one- to two-page paper
    5·1 answer
  • Nathan would like to save his PowerPoint presentation as a video that can be replayed easily on any device at full quality. Whic
    14·1 answer
  • While Angela is making modifications to Katie’s Word document, she would like to inform Katie of the reasoning for the change. W
    10·1 answer
  • Where can the Field Service Manual containing Critical Callout, Disassembly and Reassembly instructions be found?
    9·1 answer
  • In this problem, you will derive the efficiency of a CSMA/CD-like multiple access protocol. In this protocol, time is slotted an
    14·1 answer
  • Doug grew up on a large farm in southwest Wisconsin. As a college graduation gift, Doug’s father gave him several hundred acres
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!