Access Millions of academic & study documents

3 Write a general program in C that runs on a PC that converts a li

Content type
User Generated
Showing Page:
1/4
3. Write a general program in C that runs on a PC that
converts a list of few cities temperatures from
Fahrenheit to degree Celsius and from degree Celsius to
Fahrenheit. The program should also sort the
list of temperatures. The program should be interactive so
that the user can select either convert
(F->C, C->F) or sort options.
a. Develop the specifications based on the requirements
(question itself)
b. Develop the architecture document including all the
design tools.
c. Develop the test plan document
d. Implement the system
Solution
#include <stdio.h>
int size;
float a[100];
void cConvert(){
int i;
for(i=0;i<size;i++)
{
a[i] = (a[i] - 32.0) / 1.8;
}

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/4
}
void sortT()
{
int i,j;
float temp;
for(i=0;i<(size-1);i++){
for(j=0;i<(size-i-1);j++){
if(a[j]>a[j+1]){
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
}
void fConvert(){
int i;
for(i=0;i<size;i++){
a[i]=1.8*a[i]+32.0;
}
}
int main()
{
int i,ch,e;

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/4

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 4 pages?
Access Now
Unformatted Attachment Preview
3. Write a general program in C that runs on a PC that converts a list of few cities’ temperatures from Fahrenheit to degree Celsius and from degree Celsius to Fahrenheit. The program should also sort the list of temperatures. The program should be interactive so that the user can select either convert (F->C, C->F) or sort options. a. Develop the specifications based on the requirements (question itself) b. Develop the architecture document including all the design tools. c. Develop the test plan document d. Implement the system Solution #include int size; float a[100]; void cConvert(){ int i; for(i=0;i ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4