Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

The Williamsburg Women's Club offers scholarships to local high school students who meet any of several criteria. Write an application that prompts the user for a student's numeric high school grade point average (for example, 3.2), the student's number of extracurricular activities, and the student's number of service activities. Display the message "Scholarship candidate" if the student has any of the following:

- A grade point average of 3.8 or above at least one extracurricular activity and one service activity.

- A grade point average below 3.8 but at least 3.4 and a total of at least three extracurricular and service activities.

- A grade point average below 3.4 but at least 3.0 and at least two extracurricular activities and three service activities.

- If the student does not meet any of the qualification criteria, display "Not a candidate."

B. Modify the Scholarship application so that if a user enters a grade point average under 0 or over 4.0, or a negative value for either of the activities, an error message appears.

The first part is below. I need help with part B. Thanks!

import java.util.Scanner;
public class Scholarship2
{
   public static void main(String[] args)
   {
      Scanner sin = new Scanner(System.in);
      float averageGrade = 0;
      int extraActivities = 0;
      int extraService = 0;
      System.out.println("Enter high school grade point average: ");
      averageGrade=sin.nextFloat();
     System.out.println("Enter number of extracurricular activities: ");
      extraActivities=sin.nextInt();
      System.out.println("Enter number of service activities: ");
      extraService=sin.nextInt();
       if (averageGrade >= 3.8 && extraActivities >= 1 && extraService >= 1)
         {
            System.out.println("Scholarship Candidate");
         }
            if (averageGrade >= 3.4 && extraActivities >= 3 && extraService >= 3)
            {
               System.out.println("Scholarship Candidate");
            }
            else
            {
               System.out.println("Not a Scholarship Candidate");
            }
               if (!(averageGrade >= 0 || !(averageGrade <= 4.0)) || (!(extraActivities <= 1 || !(extraService >= 3))))
               {
                  System.out.println("Invalid Entry");

Java, Programming

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

Have any Question?


Related Questions in Java

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

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 ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

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 -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

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 ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

  • 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