Write a program that asks the user to input an integer n

Assignment Help JAVA Programming
Reference no: EM131915579

Assignment

Program 1

A local school system must report average weekly attendance percentages to the state on each Friday afternoon. Your task is to write a program that takes multiple school's attendance numbers for a week and computes the information needed for the report to the state.

Your program should first ask the user how many schools there are in the district. The program should then ask the user to enter each day's attendance numbers for each school for the week as well as the number of students enrolled in that school. The program should output the average attendance for the week for each school as well as the average percentage of students present that week. You must use nested FOR loops to collect the attendance input from the user. You are NOT allowed to use an array for any purpose in your program.

All console output should have meaningful descriptions. While you can't yet recover from errors generated by users entering character data for input, make sure you validate numbers entered by the user are within appropriate numeric ranges for correct input to the program. For example, the program wouldn't do anything if there were 0 schools entered. There are other cases to figure out on your own.

Program 1 sample execution & output (user input shown in bold):

How many schools do you have in your district: 2

Enter data for school 1
How many students are enrolled in school 1: 580
Enter the attendance for day 1: 502
Enter the attendance for day 2: 521
Enter the attendance for day 3: 550
Enter the attendance for day 4: 555
Enter the attendance for day 5: 568

School 1 had an average attendance of 539 students which means there were 92.93% of all students present

Enter data for school 2

How many students are enrolled in school 1: 350
Enter the attendance for day 1: 302
Enter the attendance for day 2: 332
Enter the attendance for day 3: 350
Enter the attendance for day 4: 325
Enter the attendance for day 5: 338

School 2 had an average attendance of 329 students which means there were 94% of all students present

School 2 had the best attendance this week with 94% attendance.

Program 2

Write a program that asks the user to input an integer, n. Use the value of n to set the size of the triangles to be printed by your program to the console as shown below.

If 6 was entered by the user as n, the first triangle printed by your program would look like this.
@
@@
@@@
@@@@
@@@@@
@@@@@@

Then, the 2nd triangle printed by your program would look like this.:

              @
           @@
        @@@
      @@@@
   @@@@@
@@@@@@

The triangles should notbe produced by 6 println statements, but rather byFOR loops and no more than threeprintln or print statements in each set of loops to produce each triangle. Furthermore, a single println or print statement cannot contain more than one @ symbol in its output. (hint - use a set of nested FOR loops for each triangle to control how many times the print statements execute.) Also, just like in program 1, you may not use an array for any purpose in this program.

You should print a single blank line after the first triangle so there is space between the two triangles in your console output.

Reference no: EM131915579

Questions Cloud

Literature review - conduct a conscientious search : Use of laptops and tables in the classroom and Use and perceptions of digital technology among postgraduate students - exercise among postgraduate students
Explain how important are communication skills in project : Explain How important are communication skills in project management? Was Herb the right person to be assigned as project manager?
How much gain will linda report as a result of the sale : Linda pays $100,000 cash for Jerry's ¼ interest in the JILL Partnership. How much gain will Linda report as a result of the sale
Calculate the effective tax rate for each corporation : Calculate the effective tax rate for each corporation. Explain why the marginal tax rate for a C Corporation can exceed 35% but the effective tax rate cannot
Write a program that asks the user to input an integer n : Write a program that asks the user to input an integer, n. Use the value of n to set the size of the triangles to be printed by your program.
What is the amount of doug taxable income : During 2012, Doug incurs the following deductible expenses: $2,300 in the state income taxes, What is the amount of Doug's taxable income
What would the court look to in making its decision : What is the impact of the court's decision on the ability of the family to recover for injuries?
Review the implementation plan in significant enough depth : Review the implementation plan in significant enough depth to demonstrate your thorough understanding of the implementation process.
Establishment of the company - legal aspects of management : Choose any LLC, SAOC or SAOG Company - Formation/establishment of the company and Dissolution and liquidation of the Company

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

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

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