Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java/C/C++ Programming in Linux Program Objective: 1. This program continues the

ID: 3764824 • Letter: J

Question

Java/C/C++ Programming in Linux Program Objective: 1. This program continues the previous project by generalizing the input values. 2. It will continue to get you acquainted with Linux (or refresh your programming experience). The compilation and execution are the same as in week 4. You may write the program in Java, C, or C++ - your choice. Editing: Program in Linux, use the editors in the Linux environment . There are a number of ways this can be done. The easiest way is to use the pico editor. Also available are vi and emacs editors. Compiling: The compiler is gcc (or g++ or javac). This can be used from the command prompt. Sample compilation is For C program: gcc –o test test.c (source program is test.c) For C++ program: g++ -o test test.cpp (source program is test.cpp) For Java program: javac test.java (source program is test.java. This command generates test.class) Executing: Here, test is the executable file name, and the execution is as follows. For C or C++ program: . /test For Java program: java test Program Description: Write a small Linux program that will calculate the temperature in degrees F, given the temperature in degrees C. (The formula is.. F = (9/5) * C + 32.0). Just like week 4 project, you must perform the calculation as a separate function, namely convert(C). Your program should ask the user to input a temperature in Centigrade and then return Fahrenheit. Continue until the user quits.

Explanation / Answer

#include <iostream.h>
float convert(float celsius)
{
fahrenheit = (celsius * 1.8) + 32;
return (fahrenheit);
}   
int main() {   
float celsius;   
float fahrenheit;

cout << "Enter Celsius temperature: ";
cin >> celsius;
fahrenheit = convert(celsius);
cout << "Fahrenheit = " << fahrenheit << endl;

return 0;   
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote