Two Part Java Problem Hard Time Sorry S Long M Really Lost 1 Write Following Static Metho Q27825947

A two-part Java problem that I am having a hard timewith… sorry it’s so long, I’m really lost:(

1) Write the following static methods. Assume the referencevariable input has already been declared for the Scannerclass:

a) A method called setName that prompts for a child’s name andreturns it:

b) A method called setSpecialPresent that accepts a child’sname, prompts for the present that the child wants the most andreturns the present. Example: What is the present Xxxxxxxxwants the most? where the Xs is the child’sname.

c) A method called behavior that receives a child’s name,prompts for the child’s behavior, and returns whether the child hasbeen good or bad as a boolean. Example: Has Xxxxxxxx beengood? Enter ‘Y’ or ‘N’: where the Xs is the child’sname.

d) A method called letterGrade that receives the child’s nameand prompts for the letter grade of all combined schoolwork. Theletter grade is returned.   Example: What isXxxxxxxx’s letter grade for all combined schoolwork?where the Xs is the child’s name.

e) A method called authorizeBDayParty that accepts a lettergrade, the child’s name, and behavior to print the followingwhen:

The letter grade is an ‘A’ and the behavior is good:wherethe first set of Xs is the child’s name & the 2ndset the special present.

Xxxxxxxx gets to have an awesome birthday party thisyear!You’ll be getting a(n) Xxxxxxxx!!!

The letter grade is a ‘B’ and the behavior is good:where theXs is the child’s name.

Xxxxxxxx gets to have a birthday party this year with asmall group of friends!

The letter grade is a ‘C’ and the behavior is good:where theXs is the child’s name.

Xxxxxxxx, we’re having a family birthday celebration foryou

Any letter grade under a ‘C’ regardless of behavior:wherethe Xs is the child’s name.

Xxxxxxxx, your overall grade or behavior has been poor,so there’ll be NO birthday party for you this year!

2) Write statements that will call each of themethods you coded above.OR write only 2 Java statements that call 4of the 5 methods with the assumption that the 5th methodis called in one of the 5.

a.

b.

c.

d.

e.  

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *