Develop a program to produce a current ratio report

Assignment Help C/C++ Programming
Reference no: EM13957177

Current Ratio - Assignment Specifications

In this assignment, you develop a program to produce a current ratio report.

The current ratio is used in accounting to measure a company's financial condition. To compute the ratio, one divides the company's current assets by the current liabilities. Here is a sample set of data (2010 to 2012). The first line is the company name, appearing in column one (a maximum of 30 characters in length). In each subsequent line, the first number (starting in column 1) represents the current assets and the second number (starting in column 10) represents current liabilities. Here is some sample data to use (no blank line appears in the data file at the beginning)

Hi-Tech    Leisure Products
47900          31007
34500          9100
57984          14822

You should write a batch (file input) program that reads this data in this format (laid out as you see it above, on four lines) from a textfile, then produces a report (sent to a disk file) that displays it along with the current ratio for each year. Assume 2010, 2011, and 2012 are the three years in question. Here's sample output for the data you see above:

Hi-Tech Leisure Products

Current Ratio Report

                 Current            Current          Current
Year            Assets            Liabilities        Ratio
----------------------------------------------------------
2010              47900             31007             1.54
2011              34500              9100             3.79
2012              57984             14822             3.91
----------------------------------------------------------

Average           46795             18310             3.08

The data will allows be whole values (no cents), but may run into the millions. No cents are to be displayed. The current ratio will always be displayed rounded to two decimal digits, and could be up to 9999.99. The averages are rounded to the nearest whole dollar.

You must create the data file in the manner discussed in the lecture.

Note that the various asset and liability numbers could be 5 digit, 4 digit, or even 3 digit or 6 digit. The numeric formats you use to print should not vary based on what you see for this particular set of sample data. Your program should be able to consistently produce a properly aligned report with all different sizes of numbers without changing the code!

Please be careful in noting how things are aligned. The "t" in "Current" is over the last digit of each number. Proper and exact alignment of all elements of the report will be part of your score.

The program must be written using modularity (voided functions), which is this week's topic. If you do not build this program using void functions, major points will be deducted.

You can "hard-code" this into the statement; it won't be necessary to use a defined constant for this.

Warning: Be careful with your calculations. The average current ratio (at the bottom of the table) is the average of the three current ratios, not the quotient of the average assets and average liabilities. The wrong algorithm will cost you major points.

Hint

You will need to use fgets() instead of fscanf() for the name of the company. fscanf() cannot read a string with embedded spaces.

You will submit only the source code file (.c) and the unaltered (ahem!) output file (.txt) from your run of the program. Place your name in the comments of the source code file and make sure your program prints your name in the last line of the report in the output file. Do not zip the files. And please, use .c for the source code and .txt for the output file. No Word documents or other such formats.

Be sure to include appropriate comments and indentation in your source code.

Verified Expert

The program was to calculate the ratio of current assets and liabilities. The output has to be redirected to a file in table format, round off to two decimal places. Finally it has to output average of assets, liabilities and ratio. So all have done as per the requirements.

Reference no: EM13957177

Questions Cloud

Solution satisfying initial conditions : Find the unique solution satisfying initial conditions y(1)=0 and y'(1)=1 for
Where are they presented on the statement of cash flows : Some companies collect interest and/or dividend payments. Where are they presented on the statement of cash flows?
Find the expected number of cats in the chair with the lady. : A lady has six cats. Each cat has a 0.60 probability of climbing into the chair in which the lady is sitting, independently of how many cats are already in the chair with the lady.
The pros and cons of using treated waste water : A third successive year of California's worst drought in a century has the Golden State's reservoirs at record lows. Agriculture has been affected, hitting the local economy, while some small communities risk running out of water.
Develop a program to produce a current ratio report : Develop a program to produce a current ratio report - The current ratio is used in accounting to measure a company's financial condition. To compute the ratio, one divides the company's current assets by the current liabilities.
Are there any qualitative factors that might enter : Assuming that Susan would be equally happy with either the Ford Focus or the Honda Civic, should she buy the Civic or repair the Focus? Explain your answer.
Particular solution of the differential equation : Find the particular solution of the following differential equation: 12(d^2y/dt^2)-3y=0 given that when t=0, y=3 and dy/dt=0.5 and could you explain the reasons for choosing y=e^(rt)
For to ensure the survivability of our species : Instructions: The movie Interstellar is based on the premise of trying to find another habitable planet after ours has become inhabitable. From the knowledge you have gained from this class, discuss the following:
Find the probabilities that in a run of 75 items : The probability that a certain machine turns out a defective item is .05. Find the probabilities that in a run of 75 items, the following results are obtained.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Generate the initial deck of cards.

It may also enable the top card in the waste pile to be placed The adjustments are made until nothing can be moved. Play continues until all of the original cards in the deck are in play and all adjustments are made

  Write a program manipulating a 2-dimensional array

Write a program manipulating a 2-dimensional array. Create constants to represent your number of students and number of assignments.

  Multiplying the current balance

The interest is calculated by multiplying the current balance, rate and time period which is one quarter of a year as in this case. A new balance is calculated by adding that interest.

  Writing a program in c that meets the following criteria

Include comments within the code to explain each of the functional areas.

  Analyze a basic set of requirements for a problem

Create the main bank program. Note that you can create the main bank program in the main function or you can try to create another class for the main bank program.

  Write a program that grades an online quiz

write a program that grades an online quiz. The program asks the student to enter his/her answer to 10 multiple-choice questions. The program stores the student's responses in an array and then compares those responses to the correct answers to de..

  Using the following program as a guide

Using the following program as a guide, write a program reads in 2 scores in the main function.. Calls a function that will triple each number. In the function and the print the result in the main function.

  Write cpp program that processes the data of retail company

Write a C++ program that processes the data of a retail company with following requirements: Define a new data type (struct) ofCustomer, with following members

  Construct an er diagram

Finally, the company is required by its insurers to maintain a record of the position of each vessel; its port and date of departure, destination and estimated date of arrival; number of officers, total number on board, and total value of cargo ca..

  Write and test c program which outputs waveform

Write and test a C program which outputs waveform which switches from 10.0 kHz with a 50% duty cycle to 25.0 kHz with a 5% duty cycle every 5 seconds.

  How many times is copy constructor called in the given code

How many times is the copy constructor called in the given code. Why are the parentheses needed in the expression (*p).data?

  Print out contents of the vector

Write C++ program to provide the subsequent functionality - Ask users to enter 10 integer numbers and Print out contents of the vector.

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