Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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.

Java, Programming

  • Category:- Java
  • Reference No.:- M92754242

Have any Question?


Related Questions in Java

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As