This question is not on answers, so if you plagiarize I will report. TWO major instructions before you start. Otherwise do

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

This question is not on answers, so if you plagiarize I will report. TWO major instructions before you start. Otherwise do

Post by answerhappygod »

This question is not on answers, so if you plagiarize I
will report.
TWO major instructions before you start. Otherwise do
not start.
1) Use C language not C++.
2) We need to make sure that the solution is
compatible with CodeWarrior in Full Chip Simulation mode. Also
attach the typed code (NO HANDWRITTEN) and also attach the output
window from the CodeWarrior.
Lab Exercise:
Write a temperature converter program in C compatible
with CodeWarrior in Full Chip Simulation mode. The
pertinent conversion relations are as follows:
Celsius = 5 * (Fahren – 32) / 9
Fahren = 9 * Celsius / 5 + 32
In your program, you will specify the temperature by the
variable temp and its type by the variable type. Use if-else
statement to perform the conversion.
Verify your program using the following test
cases:
SOLUTION:
Step 1 – Analyze the Problem
There are two inputs: int temp and char type.
Similarly, there are two outputs, namely: int otemp and char
otype.
******These output variables must be declared on top of
void main() to make them global.******
Step 2 – Find a solution
Need to compare type with ‘F’ and compute otemp = 9 * temp / 5 +
32
Else we need to compute output temperature using the other
formula.
Hand computation shows
Step 3 – Code the Solution
Copy and paste your full C code here:
Step 4 – Run and Debug the Program
From running the code, copy and paste Debug window showing the
results of (a) here:
Copy and paste Debug window showing the results of (b) here:
Copy and paste Debug window showing the results of (c) here:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply