- 1
How to create temperature converter using array of structure c++
Can u guys show me the code. I'm having a hard time with this one
10 ответов
0
If you need help, please give a COMPLETE TASK DESCRIPTION.
It is unclear what data should e converted to from which unit to which other unit. It is unclear what the array stores.
0
If you want help, 👉 READ THE REPLIES COMPELTELY.
⭐⭐⭐⭐⭐
GIVE THE COMPLETE TASK DESCRIPTION
⭐⭐⭐⭐⭐
0
From the given information it is unclear what the input looks like or if we have given data. It is unclear what purpose an array of structure serves here...
0
Thats the only information given
0
Ill attach code sample
0
#include<iostream>
#include<stdlib.h>
#include<cstring>
using namespace std;
struct student
{
char name[20];
char coursec[15];
char subj[2][10];
int grade[2];
char graderemarks[2] [7];
};
struct student stud[3];
char remarks[2][7] = {"PASSED","FAILED"};
int i,j;
int main()
{
for(i=0;i<=2;i++)
{
cout<<"STUDENT "<<i+1<<endl;
cout<<"Name : ";
cin.getline(stud[i].name,20);
cout<<"Course/Section : ";
cin.getline(stud[i].coursec,15);
cout<<"Subject : \n";
for (j=0;j<=1;j++)
{
cout<<"("<<j+1<<") ";
cin.getline(stud[i].subj[j],10);
cout<<"Grade : ";
cin>>stud[i].grade[j];
if (stud[i].grade[j]>=75)
{
strcpy(stud[i].graderemarks[j],remarks[0]);
}
else{
strcpy(stud[i].graderemarks[j],remarks[1]);
0
Second example
0
#include<iostream>
#include<stdlib.h>
#include<cstring>
using namespace std;
struct student
{
char name[20];
char coursec[15];
char subj[2][10];
int grade[2];
char graderemarks[2] [7];
};
struct student stud[3];
char remarks[2][7] = {"PASSED","FAILED"};
int i,j;
int main()
{
for(i=0;i<=2;i++)
{
cout<<"STUDENT "<<i+1<<endl;
cout<<"Name : ";
cin.getline(stud[i].name,20);
cout<<"Course/Section : ";
cin.getline(stud[i].coursec,15);
cout<<"Subject : \n";
for (j=0;j<=1;j++)
{
cout<<"("<<j+1<<") ";
cin.getline(stud[i].subj[j],10);
cout<<"Grade : ";
cin>>stud[i].grade[j];
if (stud[i].grade[j]>=75)
{
strcpy(stud[i].graderemarks[j],remarks[0]);
}
else{
strcpy(stud[i].graderemarks[j],remarks[1]);
- 1
It should be converted into Fahrenheit, Kelvin and Celsuis
- 1
program using basic program structure ( sequential or
selection) convert it utilizing array of structure