Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Programming Language Expert

Problem1) Define the class for a type called Fraction. This class is used to represent a ration of two integers. Include mutator functions which permit the user to set numerator and the denominator. In addition, include a member function which returns the value of numerator divided by denominator as a double. Include another member function which outputs the value of the fraction reduced to lowest terms. Such as, instead of outputting 20/60 the function must output 1/3. This needs finding the greatest common divisor for the numerator and denominator, and then dividing both by that number. Embed your class in a test program.

For ex, you may prepare a test program which asks the user for an integer numerator and integer denominator, print the real number from evaluating the fraction, and then print the fraction reduced to its lowest terms.

Enter a numerator: 20

Enter a denominator: 60

The result of your fraction is .333333.

Your fraction in lowest terms is 1 / 3.

Problem2) Create a Temperature class which internally stores a temperature in degrees Kelvin. Create functions named setTempKelvin, setTempFahrenheit, and setTempCelsius which take an input temperature in the specified temperature scale, convert the temperature to Kelvin, and store that temperature in the class member variable. Also, create functions which return the stored temperature in degrees Kelvin, Fahrenheit, or Celsius. prepare the main function to test your class. Use equations shown next to convert between the three temperatures scales.

Kelvin = Celsius + 273.15

Celsius = (5.0 / 9) * (Fahrenheit – 32)

For ex, you may ask the user which type of temperature he/she wishes to enter, and then output the temperature in Kelvin, Fahrenheit, and Celsius.

Which type of temperature will you like to enter (Kelvin (1), Fahrenheit(2), or Celsius(3))? 1

Enter your temperature: 20.0

Your temperature in Kelvin is 20.

Your temperature in Celsius is -253.15.

Your temperature in Fahrenheit is -423.67.

In your implementation, ensure that you include the program header in your program, also to proper indentation/spacing and other comments!

Understanding the Problem

In your own words, describe what YOU think the problem is asking you to do. In this section, document your uncertainties about problem and anything else which you feel was unclear or vague. This is to make sure that YOUR understanding matches MY understanding of the problem.

Devising a Plan/Design

At a minimum, provide the algorithm/pseudo code you designed to help solve the problem. Also, include pictures/flow charts you used to help you devise your plan, as well as any other design decisions you made such as how to manage your time, how to decompose problem, where to start first, etc. You could scan any handwritten work and attach it to the document as needed.

Looking Back/Self-Reflection

Report any checking/self-reflection you did while solving the problem. For ex, how did you make sense of the output from the implementation? This includes things like using a calculator to ensure the output is accurate; testing to ensure your code runs correctly and behaves the way you expect under specific situation, using external sources of information like the internet to make sense of the results, etc.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91663

Have any Question? 


Related Questions in Programming Language

1 loops the greatest and the least- write a program with a

1. Loops: The greatest and the least- Write a program with a loop that lets the user to enter a series of integers. The use should enter -99 to signal the end of the series. After all the numbers have been entered, the p ...

Write a program that calculates several possible tips to

Write a program that calculates several possible tips to give to a waiter at a restaurant. Ask the user to enter the total cost of the meal and then calculate a tip at 10%, 12.5%, 15%, 17.5%, and 20%. Write the original ...

Your problem is as followswrite a program that will ask the

Your problem is as follows: Write a program that will ask the user to enter 4 quiz scores for 3 students.  You will need to fine the lowest quiz grade and drop it out when you calculate the average. You will need to disp ...

Engineering programmingi need this now please accurate

Engineering programming I need this now please accurate answers and must be high rated Problem #1 Write a program that asks the user to input the number of miles and convert the miles to kilometers, and then print the ou ...

Purposethe purpose of this assignment is to practice using

Purpose: The purpose of this assignment is to practice using loops, selections, and other basic features of Java in order to solve a real-world problem. Program Description: The Jeddah Broker Company is one of the compan ...

Electrical engineering computer methods assignmentq1 write

Electrical Engineering Computer Methods Assignment Q1. Write a program that given the following array, reverses all array elements and then prints them. int x[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; Q2. Write a program to d ...

The briefyour small development team of ideally three

The Brief Your small development team of (ideally) three people has been asked to implement and test the Human Resource Information System desktop application. Your software product will be a database- backed desktop app ...

Assignmentyou will write a program that acts like a simple

Assignment You will write a program that acts like a simple calculator for binary numbers. You should read in a string of input that has the format: number operator number. Each of the numbers should be presented in two' ...

Write a program to test for the case of a math equation

Write a program to test for the case of a math equation entered via the keyboard using the SWITCH-CASE operator. Types of equations to test for: x + y  x / y   x * y and x - y. The program is to ask for the following: 1. ...

Shell programmingyou have created the directory structure

Shell Programming You have created the directory structure and some base files to be used by the Web server and Web site. For the Web site to be created in a production environment, you need to package your commands in a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate