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

. . Class work: Writing Programs Write a Program Segment: 1 . Write a C++ progra

ID: 649118 • Letter: #

Question

. . Class work: Writing Programs Write a Program Segment: 1 . Write a C++ program that reads two integer values from the user and prints their integer quotient and remainder. A sample run of the program might be (input shown in boldface italic). The user may NOT necessarily enter 57 and 8 as input: NOTE: You may NOT do the calculation of quotient and remainder in the cout statement. In other words, you need to declare two variables like quotient and remainder and calculate the values of these variables from the input values entered by the user. . ? 2. Consider that an European tourist is visiting America. The tourist reads the weather report to decide how to dress for the day. . However, the temperature is reported in Farenheit. Analyze this problem and provide the algorithm needed. Hint: Celsius = 5/9 * (Fahrenheit - 32); Also, consider what occurs with integer divide. .

Explanation / Answer

Answer 1 -

#include<iostream.h>
#include<conio.h>

void main()
{
   int dividend, divisor, reminder, quotient;
   clrscr();

   cout<<" Enter the Dividend";
   cin>>dividend;

   cout<<" Enter the Divisor";
   cin>>divisor;

   reminder = dividend % divisor;
   quotient = dividend / divisor;

   cout<<" Reminder is "<<reminder;
   cout<<" Quotient is "<<quotient;

   getch();
}

Answer 2 -

#include<iostream.h>
#include<conio.h>

void main()
{
   float celc, fera;
   clrscr();

   cout<<" Enter the Tempreture in Farenhite";
   cin>>fera;

   celc = (fera-32)*5/9;

   cout<<" Tempreture in Celcius is "<<celc;

   getch();
}