Ciss 110 Programming – Essay – jaquan mckenzie
Search
Essays
Sign up
Sign in
Contact us
Tweet
Index
/Science
Ciss 110 Programming
CISS 110 Programming & Logic IFall 2017Project 1Due Date: Sunday, November 12, 2017Write a program called Budget. Name your file Budget.java This program will use nested loops to calculate whether an individual is over or under their budget each month. It will read data from an input file and write the results to an output file. The outer loop will run as as long as there is more data in the file. This outer loop should be a while loop and use the Scanner method hasNext() to determine whether it should continue. Within the outer loop, acquire the month and the total budgeted for the month. The month will be the first line of each data set contained in the input file and it should be read and stored in a String variable. The amount budgeted for the month will be the second line of each data set and it should be read and stored in a double variable. Then, an inner loop will iterate six times, one per budget category. The six categories are: food, rent, utilities, clothing, entertainment, personal care. The file will contain the amount spent for each category, one amount per line. The program will keep track of the total amount spent. This running total will be stored in an accumulator variable. This variable will have to be initialized to zero outside the inner loop but inside the outer loop. The inner loop will be a for loop that will iterate six times, from 0 to 5. When the for loop has completed execution, the accumulator variable will contain the total expenses.
After the inner loop completes, write the specified output to the output file: the month, the amount budgeted and the total amount spent (accumulated in the for loop) for the month. Then, calculate whether the user went over or under the budget for that month and write this data to the file. The input file, the file you will read from, is called budgetInput.txt. Hard code the name of this input file in your program. The File and Scanner classes can be used to read from the file. You can assume this file exists. A sample file has been provided to you, but it will not be the file used to grade your project. The input file will have the following format:Month (String)Total Budgeted for month (double)Food expense (double)Rent expense (double)Utilities expense (double)Clothing expense (double)Entertainment expense (double)Personal care expense (double)Example of one month’s data:January500100200200105040These eight lines will repeat for however many months the user has chosen to create. The first line is the month, January. The second line contains the total budgeted for January, and the six lines of numbers represent the expense for each of the categories.
Continue for 2 more pages »
Read full document
Download as (for upgraded members)
Citation Generator
MLA 7
CHICAGO
(2017, 12). Ciss 110 Programming. EssaysForStudent.com. Retrieved 12, 2017, from
“Ciss 110 Programming” EssaysForStudent.com. 12 2017. 2017. 12 2017 <
"Ciss 110 Programming." EssaysForStudent.com. EssaysForStudent.com, 12 2017. Web. 12 2017. <
"Ciss 110 Programming." EssaysForStudent.com. 12, 2017. Accessed 12, 2017.
Essay Preview
By: jaquan mckenzie
Submitted: December 4, 2017
Essay Length: 696 Words / 3 Pages
Paper type: Essay Views: 296
Report this essay
Tweet
Related Essays
Definitions of Linear Programming:
Definitions of Linear Programming: A mathematical procedure for minimizing or maximizing a linear function of several variables, subject to a finite number of linear
1,432 Words | 6 Pages
Lack of Funding of Sports Programs
Lack of Funding Of Sports Programs Lack of Funding in Sports Programs is causing schools and after school programs to drop sports all together. Sports
798 Words | 4 Pages
Student Drug Testing Program
Student Drug-Testing Program: An Overview The Problem By the 12th grade more than one-third of high-school seniors have used drugs. Teens surveyed say drugs are
876 Words | 4 Pages
Answering the Need for an Art Centered After-School Program
ANSWERING THE NEED FOR AN ART CENTERED AFTER-SCHOOL PROGRAM Answering the Need for an Art Centered After-School Program Rhonda Bush Program Development HS 33, Kennesaw
308 Words | 2 Pages
Similar Topics
Funding United States Space Program
Loyalty Programs Indian Retail
Get Access to 89,000+ Essays and Term Papers
Join 209,000+ Other Students
High Quality Essays and Documents
Sign up
© 2008–2020 EssaysForStudent.comFree Essays, Book Reports, Term Papers and Research Papers
Essays
Sign up
Sign in
Contact us
Site Map
Privacy Policy
Terms of Service
Facebook
Twitter