Creating main function that opens the input file

Assignment Help Programming Languages
Reference no: EM1350410

Q1) Start out with a new project (you can add code to it from your previous projects)
Create a class called [Calcs]. This class has two functions: [Add2] and [Multiply2]. Each function takes two parameters and returns the value of the calculation (either adds the two parameter values, or multiplies them).

Create an input file that contains data such as the following
A 2 3
M 5 7
A 6 11
A 2 22
M 79 62

Create a main function that opens the input file, reads each line, and based on the first character in the input line, calls the [A]dd function or the [M]ultiply function.

Once you have calculated the result (one line at a time), write the result to an output file.

Reference no: EM1350410

Questions Cloud

Basic tenets of carl rogers client-centered therapy : What are the basic tenets of Carl Rogers' Client-Centered Therapy? What about Gestalt theory, as dictated by Fritz Perls?
Explain how will a depreciation of the rand influence : If the prices of gold and other commodities increases how will this influence the value of rand. Explain how will a depreciation of the rand influence our exports and imports.
Increasing employee productivity : Show the ways that HRM can implement pay for performance programs and activities aimed at increasing employee productivity.
Explain effective supply chain management relies on trust : Explain effective supply chain management relies on high levels of trust- cooperation collaboration and honest, accurate communications.
Creating main function that opens the input file : Create a main function that opens the input file, reads each line, and based on first character in input line, calls the [A]dd function or [M]ultiply function.
What would the diameter of the space station : A bucket of water is whirled in a vertical circle of radius 90cm,What is the least speed that will keep the water from falling out.
Businesses work to compliment or substitute : Marc has opened a twenty-four hour fitness center in a fast growing city. Before buying the franchise and starting his new business, Marc looked at the one other fitness center currently operating in that area.
Employee termination case- harry vs sally : How do you let them know they will no longer have a job with your company and what steps do you take so you feel good about your decision
Treatment of a sensorimotor disorder : I need assistance regarding the treatment of a sensorimotor disorder. Can you compare and contrast the different approaches to treating the disorder that can be identified as it relates to its effectiveness of treatment?

Reviews

Write a Review

Programming Languages Questions & Answers

  Design a benefits election system

Individual project for this course is in form of Service Request from Huffman Trucking. It is essential for student to access Service Request: SR-ht-001. Design a Benefits Election System.

  Program to compute unit price of items sold

Manager of a Supermarket would like to be able to calculate the unit price of items sold there. To do this the program should input the name and the price of the item.

  Program a maze-type game using assembly language

Project requires you to program a maze-type game using Assembly Language, it is not acceptable to use any other programming language for this project

  Program to prompt a user for hourly pay rate

Create program called "calculatePay" which will prompt user for their hourly pay rate.

  Method to pass string argument and returns first line

Write a method, getFirstLine, that is passed a String argument and that returns the first line.

  Program to prompts user for integer and print prime number

Give a program which will compile in VS 2010. Write a program to prompts user for integer and then prints out all prime numbers up to that integer.

  Explaining exception handling using program

Use exception handling appropriately. Use comments to illustrate the various concepts applied / utilized in the solution.

  Application to convert kilometers in miles

Application will input number of kilometers, compute number of miles, and display number of miles. You will use a constant to store the kilometers-to-miles conversion factor.

  Development of the current strategic potential of airline

Evaluate the organisation's current external and internal strategic position

  Class to create and draw five squares

Now write applet DrawSquares that uses your Square class to design and draw 5 squares. This code must be very simple.

  Create class templates for administrative employess

Create classes or class templates for the following: Administrative Employess are paid a salary, but they also receive a bonus at regular intervals during the year.

  Recursive method to read in string of characters

Trying to write a recursive method that reads in a string of characters and checks to see if the first character is either a 'D' or and 'E', then is followed by a string of one or more 'F's.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd