Ask Question, Ask an Expert


Ask Programming Language Expert

problem 1) You would create a program that would do temperature conversions, from Celsius to Fahrenheit, and from Fahrenheit to Celsius. Your program will read input from a text file named “temps.txt”. This file would contain the following information:

• A letter, ‘c’ or ‘f’, which indicates type of the temperature given

• The temperature itself your main function will read data from the file. Your program would have 2 functions:

i) One function to validate the data. Temperatures can’t be below absolute zero. Look up the temperatures for Celsius and Fahrenheit representations for absolute zero. If temperature given is below this threshold, then you must return a flag back to main() which indicates this.

ii) Other function to do all conversions. This function should be of type void, and would be called temp_convert. If the letter read from the file is ‘c’, then you must convert to Fahrenheit. If the letter read is ‘f’, then you must convert to Celsius. There should be NO return statements in this function.

Continue to read data from the file until you run out of data: don’t count how many lines of data there are and make your reading dependent on that. Consider: if different-length input file was run against your code, will your project break? Your project must be able to run input files of all lengths. Output the results in the well-formatted table. You would have a column of Celsius temperatures, and a column of Fahrenheit temperatures. If any temperature was below the absolute zero threshold, then the table must say “Too Cold!” where the conversion would have otherwise been. (Use your “flag” from above to execute this.) Make use of formatting methods we have discussed this semester to make your columns straight and even.

Programming Language, Programming

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

Have any Question? 

Related Questions in Programming Language

Complete the below two problems each problem is a separate

Complete the below two problems. Each problem is a separate program (project). Question 1 Write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the follow ...

Programming taskswhile working on the tasks below you are

Programming tasks While working on the tasks below, you are free to request assistance on D2L at: Communications / Discussions / Assignments (or other appropriate sub-topic) These tasks entail modifying your prior code f ...

Assignment programming project expression treesthis project

Assignment Programming Project: Expression Trees This project deals with a simple kind of expression trees, in which there are two kinds of nodes: (a) Leaf nodes, which contain a real number as their clement; and (b) Non ...

First write a program that reads students names followed by

First... Write a program that reads students' names followed by their test scores. The program should output each student's name followed by the test scores and the relevant grade. It should also find and print the highe ...

Frans virtual fruit standuse the concepts and scenario from

Frans Virtual Fruit Stand Use the concepts and scenario from Assignment to help Fran's Virtual Fruit Stand increase the functionality of its online shopping cart. When a customer checks out, the shopping cart must store ...

Project instructionsinstructions complete the following two

Project Instructions Instructions: Complete the following two assignments as your final project. These two assignments review everything you learned from Chapters 1-8. Assignment 1 Write an application containing three p ...

Program assignment multi-threaded programming in java

Program Assignment: Multi-threaded Programming in Java Using Locks Objectives: To practice programming cooperating, synchronized multiple threads of execution. Description: In this programming assignment you will simulat ...

Assignmentthe fourth programming project involves writing a

Assignment The fourth programming project involves writing a program to manage a student database. The interface to the program should be a GUI that looks similar to the following: A combo box should allow the user to se ...

Assignmentreference this assignment is an object oriented

Assignment Reference: This assignment is an object oriented version of the In-class assignment. The functionality supported for a single vehicle in ICA 01 would be extended to multiple vehicles using a single class Car, ...

Pennies for pay you are hired for a job and your employer

Pennies for Pay You are hired for a job and your employer agrees to pay you each day. Your pay rate will be one penny the first day and two pennies the second day, four pennies the third day and continuing to double each ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen