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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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