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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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