Question

For the following Programming Challenges, use a modular approach and pseudocode to design a suitable program...

For the following Programming Challenges, use a modular approach and pseudocode to design a suitable program to solve it. Whenever appropriate, validate the input data.
Allow the user to enter a series of temperatures in degrees Celsius (C) terminated by the input of −999. For each one, find the corresponding temperature in degrees Fahrenheit (F). The conversion formula is:
F = 9 * C/5 + 32

0 0
Add a comment Improve this question Transcribed image text
Answer #1

program

#include<stdio.h>
#include<stdlib.h>
static int size=0;
static double a[100],b[100];
//input method to input the data
void input_celcius()
{
    int i=0;
    //input the data
    printf("Enter the temperature in celcius, input -999 to terminate");
//infinite loop for entering the data
while(1)
    {
       //read the data from user
       scanf("%lf",&a[i]);
    //validate the input data for terminate the loop
       if(a[i]==-999)
       break;
       //increment the index
       i++;
   }
   //update the size
   size=i;
   //disply the input data
   printf("\n The temperatures in celcius are : ");
   for(i=0;i<size;i++)
   printf("%8.2lf",a[i]);
}
//method to convert the temperature into farenhite
void farenhite()
{
    int i;
    //loop to convert the data to farenhite
    for(i=0;i<size;i++)
   b[i] = 9 * (double)a[i]/5 + 32;
   //display the converted data
      printf("\n The temperatures in Farenhite are : ");
   for(i=0;i<size;i++)
   printf("%8.2lf",b[i]);
   
}
//driver program
int main()
{
   input_celcius();
    farenhite();  
}

output

Add a comment
Know the answer?
Add Answer to:
For the following Programming Challenges, use a modular approach and pseudocode to design a suitable program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • USING RAPTOR For the following Programming Challenges, use the modular approach and pseudocode to design a suitable program to solve it. Create a program that allows the user to input a list of first...

    USING RAPTOR For the following Programming Challenges, use the modular approach and pseudocode to design a suitable program to solve it. Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input should be terminated when the user enters a sentinel character. The output should be a list of email addresses where the address is of the following from: [email protected]

  • write a python program that use while and for loop.

    Write a Python program that- Uses a while loop to produce a table that shows the conversion of degrees Celsius to degrees Fahrenheit between 0 degrees Celsius and 100 degrees Celsius. Theconversion formula is Fahrenheit = Celsius * 9 / 5 + 32-Uses a for loop to produce a table that shows the conversion of degrees Fahrenheit to degrees Celsius between 0 degrees Fahrenheit and 100 degrees Fahrenheit. Theconversion formula is Centigrade = (Fahrenheit – 32) * 5/9.-Each conversion table...

  • Create a program in Python that will allow the user to enter a temperature in Fahrenheit...

    Create a program in Python that will allow the user to enter a temperature in Fahrenheit which will then be converted to degrees Celsius. The program will keep asking the user for a Fahrenheit temperature until the user enters Q to quit. After each conversion the program needs to print out the degrees Celsius. The input prompts for this problem need to look like the following: Degrees Fahrenheit: Continue: For these input prompts watch the capitalization and spacing. There are...

  • CIST 1305 – Program Design and Development Chapter 4 Assignment #7 [Decisions/If Statements & Loops] (50...

    CIST 1305 – Program Design and Development Chapter 4 Assignment #7 [Decisions/If Statements & Loops] (50 Points) Please do the following exercises: Pastoral College is a small college in the Midwest. Design the pseudo-code for a program that accepts a student name, major field of study, and grade point average. Display a student’s data with the message “Dean’s list” if the student’s grade point average is above 3.5, “Academic probation” if the grade point average is below 2.0, and no...

  • Temperature Converter Create a temperature conversion program that will convert the following to Fahrenheit: Celsius Kelvin...

    Temperature Converter Create a temperature conversion program that will convert the following to Fahrenheit: Celsius Kelvin Newton Your program should take a character which represents the temperature to convert from and a value to be converted to using the following specification: C - Celsius K - Kelvin N - Newton In addition your program should take in the following character to exit the program: X - eXit the program The numeric input for your program should be of type double....

  • Q2 Write pseudocode and flow chart of the following problem Qi. Write pseudocode and flow chart...

    Q2 Write pseudocode and flow chart of the following problem Qi. Write pseudocode and flow chart that prompts (input) the capacity, in gallons, of an automobile fuel tank and the miles per gallon the automobile can be driven. The program outputs the number of miles the automobile can be driven without refueling. Q ii. Centigrade and Fahrenheit are two scales to measure temperature. Write pseudocode and flow chart that that prompts (input) the user to enter Centigrate and then print...

  • This program will take the user's input as a temperature in degrees Fahrenheit. The user will...

    This program will take the user's input as a temperature in degrees Fahrenheit. The user will then click a radio button indicating whether a table of temperatures, starting with the entered value, will be displayed in increments of 5 degrees F or 10 degrees F. When a submit button is clicked your code will display a HTML table of temperature values. The first column will be temperatures in degrees Fahrenheit, given in increments of 5 or 10 degrees F, depending...

  • Programming Exercise 8.3 | Instructions Write a GUI-based program that allows the user to convert temperature...

    Programming Exercise 8.3 | Instructions Write a GUI-based program that allows the user to convert temperature values between degrees Fahrenheit and degrees Celsius. The interface should have labeled entry fields for these two values. breezypythongui.py temperatureconvert... + 1 2 File: temperatureconverter.py 3 Project 8.3 4 Temperature conversion between Fahrenheit and Celsius. 5 Illustrates the use of numeric data fields. 6 • These components should be arranged in a grid where the labels occupy the first row and the corresponding fields...

  • B - Temperatures You may use the CodeCheck IDE directly to write this program. (Your program...

    B - Temperatures You may use the CodeCheck IDE directly to write this program. (Your program will be graded by CodeCheck). Here are the requirements: Complete the class Temperatures (you must use this exact name to pass CodeCheck) so that it prompts the user for a temperature value, followed by a character that represents the type of temperature. The second input value is the string "F" for Fahrenheit or "C" for Celsius. If the string is an "F", the temperature...

  • Write a program that would ask the user to enter an input file name, and an...

    Write a program that would ask the user to enter an input file name, and an output file name. Then the program reads the content of the input file, and read the data in each line as a number (double). These numbers represent the temperatures degrees in Fahrenheit for each day. The program should convert the temperature degrees to Celsius and then writes the numbers to the output file, with the number of day added to the beginning of the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT