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

C++ HELP Complete the implementation of the following programs Q4. // This progr

ID: 3562401 • Letter: C

Question

C++ HELP

Complete the implementation of the following programs

Q4.
// This program prints the day of the week input the day number (1-7).
#include <iostream>
using namespace std;
int main()
{
int dayNumber;
cout << "Enter day number" << endl;
cin >> dayNumber;
// Complete the remaining program. Include a default case with the message
// "Input should be from 1 to 7".
switch(dayNumber) {
}
}


Q5.
// This program calculates the factorial of a number n.
// The factorial of a number = 1*2*...(n-2)*(n-1)*n
#include <iostream>
using namespace std;
int main()
{
int factorial = 1, num;
cout << "Input number" << endl;
cint >> num;
// Complete the remaining program using a for loop
return 0;
}

Q6.
Write a program that find the temperature, as an integer, that is same in both Celsius and Fahrenheit.
The formula to convert from Celsius to Fahrenheit is as follows: Fahrenheit = (9/5)*Celsius + 32
#include <iostream>
using namespace std;
int main()
{
int tempC = 100, tempF;
// Complete the remaining program. In a loop, decrement the Celsius value and
// compute the corresponding temperature in Fahrenheit until the two values
// are the same
return 0;
}

Explanation / Answer

#include <iostream>
using namespace std;
int main()
{
int dayNumber;
cout << "Enter day number" << endl;
cin >> dayNumber;
// Complete the remaining program. Include a default case with the message
// "Input should be from 1 to 7".
switch(dayNumber) {
  
case 1: cout<<"monday"<< endl;break;
case 2: cout<<"tuesday"<< endl;break;
case 3: cout<<"wednesday"<<endl;
break;
case 4: cout<<"thursday"<< endl;
break;
case 5: cout<<"friday"<< endl;break;
case 6: cout<<"saturday"<< endl;break;
case 7: cout<<"sunday"<< endl;break;
}
}

#include <iostream>
using namespace std;
int main()
{
int factorial = 1, num;
cout << "Input number" << endl;
cin >> num;
// Complete the remaining program using a for loop
int i;
for(i=1;i<=num;i++)
{
factorial=factorial*i;
}
cout<<factorial<<endl;
return 0;
}


#include <iostream>
using namespace std;

int main()
{
int tempC=100;
int tempF;

int x=1;
while(x){
tempF=(int)(((float)9/5)*tempC)+32;
if(tempF==tempC)
{
cout<<"At "<<tempC<<" temperature both F and C are equal"<<endl;
x=0;
break;
}
else
{
tempC--;
}
}
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