Skip to Content

Translate Page

Use of arrow keys when focused on the Google language option field will translate site content on the fly. Use your enter key to review all options and choose your selection before applying.
McFarland School District
McFarland High (9-12)
  • McFarland High (9-12)
    • McFarland High School
    • Academic & Career Planning (ACP)
      • Youth Apprenticeship
    • Athletic & Activity Code of Conduct
    • Canvas Login
    • Clubs
    • Communications
    • Course Supply List
    • Daily Announcements
    • Daily Schedules
    • Family Handbook
    • Grading Handbook
    • Graduation Information
    • Library Media Services
    • Music
    • Office Staff
    • PBIS
    • Portfolio Resources
    • Progressive Behavior Response Plan
    • Report Suspicious Activity
    • School To Career
    • Spartan Headquarters
    • Special Education
    • Sports
      • Boys Teams
        • Baseball
        • Basketball
        • Football
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Swimming
        • Tennis
      • Coed Teams
        • Cross Country
        • Track & Field
        • Wrestling
      • Girls Teams
        • Basketball
        • Dance
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Softball
        • Swimming
        • Tennis
        • Volleyball
      • 24-25 Sport Registration-Athletic Code Video
      • Athletic & Activity Code of Conduct
      • Concussion & Sudden Cardiac Arrest Info
      • Infinite Campus Sport Registration Info Sheet
      • Parent Resources
      • Parent Transportation Form
      • Spartan Sport Sponsors
      • Uniform Care Info
      • WIAA Medical Eligibility Form
    • Staff Directory
    • Student Services
      • Transcript Request (former students)
    • Xello - Student
    • Web Design 1
      • Class Lessons
        • XHTML Tutorial
        • CSS Tutorial
        • Form Tutorial
        • Graphics
        • Dreamweaver
        • QuickMenu
        • Joomla!
      • Assignments
        • Site 1: Biography
        • Site 2: Fan Club
        • Site 3: Mixed Media
        • Site 4: Joomla!
      • Student Samples
        • Biography Sites
        • Fan Club Sites
        • Mixed Media Sites
        • Joomla! Sites
      • Helpful Sites
        • XHTML Help
        • CSS Help
        • Validation
        • QuickMenu
        • Joomla! Help
    • Web Design 2
      • Class Lessons
        • JavaScript Tutorial
        • PHP Tutorial
        • MySQL Tutorial
        • Admin - CMS
      • Assignments
        • Using JavaScript
        • For the Birds
      • Helpful Sites
        • JavaScript Tutorials
        • RegExp Help
        • Web Page Validation
    • Programming 1
      • Class Lessons
        • CLASS SET-UP
        • Logic Test
        • Class Preparation
        • Using BlueJ
        • --------------------
        • SET 1 LESSONS:
        • Printing
        • Variables
        • User Input
        • Random Number
        • Arithmetic
        • --------------------
        • SET 2 LESSONS:
        • If
        • Switch
        • --------------------
        • SET 3 LESSONS:
        • Looping
        • --------------------
        • SET 4-5 LESSONS:
        • Arrays
        • --------------------
        • SET 6 LESSONS:
        • String Manipulation
      • Problem Sets
        • Set 1: Basic Skills
        • Set 2: If & Switch
        • Set 3: Loops
        • Project: Craps
        • Set 4: Single Array
        • Set 5: Double Array
        • Set 6: Strings
      • Solution Sets
        • Problem Set 1
        • Problem Set 2
        • Problem Set 3
        • Problem Set 4
        • Problem Set 5
        • Problem Set 6
      • Helpful Sites
    • Programming 2
      • Class Lessons
        • Using BlueJ
        • What is an Object?
        • What is a Class?
        • GUI Programming
      • Problem Sets
        • Set 1 - Shapes
        • Set 2 - Exercises
        • Set 3 - Exercises
        • Set 4 - Exercises
        • Project - Adding
        • Set 5 - GUI by Hand
        • Project - NetBeans
        • Set 6 - NetBeans
        • Project - Life
        • Project - Slide Puzzle
        • Project - Matching
      • Solution Sets
        • Problem Set 1 (none)
        • Problem Set 2 (none)
        • Problem Set 3 (none)
        • Problem Set 4
  • Home
  • District
    • Referendum November 5, 2024
      • Impact Tax Calculator
    • Strategic Plan
    • School Board
      • Agendas, Minutes & Notices
      • Board Member Informational Brochure
      • District Policies
      • Meeting Calendar
      • Meeting Recordings
      • Members
      • Non-Discrimination Policy
      • Notice of Educational Options
      • Notices
      • Resolutions
    • Departments & Administration
      • District Administrator Message
        • Tarnutzer's Travels
      • Diversity, Equity, Inclusion & Belonging
      • Administrative Staff
      • Building & Grounds
        • Facility Use / Rental
      • Business Services
      • Finances
      • Health Services
      • McFarland Recreation Activities & Play (MRAP)
        • Current Events / News
        • Community Recreation Partners
      • Public Records Requests
      • School Nutrition
        • Lunch Menus
      • Special Education
        • What is Special Education?
        • Contact Information
        • Resources
      • Student Services
        • Community Resources
        • District Programs
        • Family Resources
        • Student Services Team Members
      • Summer School
      • Teaching & Learning
        • Assessments for Learning
        • Curriculum
        • Wisconsin Academic Standards
        • Early Literacy - Wisconsin Act 20
      • Transportation
        • Bus Safety Videos
        • StopFinder
    • Prospective Families & Staff
      • About McFarland
      • District Boundary Map
      • District Mission & Vision
      • Employment
      • Enrollment Process
        • Online Enrollment
      • Open Enrollment
      • Residency Questions
      • School and District Report Cards
    • Staff Resources
      • Assessment Calendar (District)
      • Assistive Technology
      • Branding/Logos
      • Building & Grounds Info Sheet
      • Calendar Dates - Staff 24-25
      • Calendar Dates - Staff 25-26
      • Canvas Login
      • Educator Effectiveness
      • Employee Assistance Program
      • Employee Handbook
      • FAQ - Employee Services
      • Field Trip Requests
      • Finance Forms
      • FMLA
      • Fundraising
      • Hiring Procedure
      • HR and Business Services
      • HR HERMAN
      • Infinite Campus Staff Login
      • Insurance
      • Maintenance & Facilities Requests
      • Mentoring Resources
      • Payroll Forms
      • PD Points Tracker
      • SeeSaw Staff Login
      • Skyward
      • Student Teacher
      • Substitute Request
      • Technology (IT) Help Desk
      • Technology Department
      • Technology Orientation
      • Time-Off
      • TSG Info & Timelines
      • Web Site Admin
      • WECAN Links
      • Xello - Staff Login
  • Families
    • All
      • 2024-2025 School Hours
      • 2024-2025 Calendar Dates
      • 2025-2026 Calendar Dates
      • Calendar - All District
      • Canvas Login
      • Communications
      • Daily Schedules
      • Emergency Protocol
      • Handbooks
      • McFarland Mobile App
      • Online Registration
        • Registration Documents
      • Safety
      • Safety and Bullying Tip Line - SUSO
      • School and District Report Cards
      • Social Media
      • Spartan Headquarters
      • Supply Lists
    • Students
      • Canvas Student Login
      • Library Resources
    • Parents/Guardians
      • Absence Reporting
      • Advanced Learner (GT)
      • Canvas Parent Login
      • Drug & Alcohol Resources
      • Dyslexia Information Guide
      • English Learners (EL)
        • Eligibility
        • Philosophy
        • DPI Language Levels
        • Resources
      • Gun Safety Resources
      • Human Growth & Development Booklet
      • Joining Forces for Families
      • McFarland Music Boosters
      • School Nutrition
      • Special Education
      • Transportation
      • Volunteer Application & Disclosure Form
      • Volunteer Handbook
      • Weather Cancellation Days
    • Important Links
      • ACT Prep
      • Drivers Ed
      • Google Apps
      • Infinite Campus
      • Lunch Menus
      • McFarland Public Library
      • Summer School
      • Work Permits
      • Xello - Student (w/Free ACT Method Test Prep
    • Other
      • McFarland Thistle
      • McFarland Youth Center
      • Outdoor Programs
        • Resources
      • McFarland School Forest
        • Bird Boxes
        • Bird Feeders
        • Bird Song Board
        • Fauna
        • Flora
        • Habitats
        • Silver Award
        • Our Supporters
  • Community
    • Community Pool
    • Facilities Use / Rental
    • McFarland Education Foundation (MEF)
    • McFarland Performing Arts Center (PAC)
    • McFarland Public Library
    • McFarland Recreation, Activities & Play(MRAP)
    • School Visitors
    • Summer School
    • Village of McFarland
  • Contact Us
    • District Office
    • School Offices
    • Staff Directory
    • Web Site Feedback
    • Spartan Shout Outs
  • A-Z Links
  • Staff Resources
  • Website Guide - Learn Your Way Around
  • 2024-2025 Calendar Dates
  • 2025-2026 Calendar Dates
  • See Something Say Something Reporting

Schools

  • McFarland Primary School (4K-2)
  • Waubesa Intermediate (3-5)
  • Indian Mound Middle (6-8)
  • McFarland High (9-12)
  • Online Virtual Charter Schools
District Home

Important Links

  • Canvas Login
  • District Calendar
  • Lunch Menus
  • Infinite Campus - Student/Parent
  • Infinite Campus - Staff
  • Staff Directory

Problem Set 2

McFarland High (9-12)

    • McFarland High School
    • Academic & Career Planning (ACP)
      • Youth Apprenticeship
    • Athletic & Activity Code of Conduct
    • Canvas Login
    • Clubs
    • Communications
    • Course Supply List
    • Daily Announcements
    • Daily Schedules
    • Family Handbook
    • Grading Handbook
    • Graduation Information
    • Library Media Services
    • Music
    • Office Staff
    • PBIS
    • Portfolio Resources
    • Progressive Behavior Response Plan
    • Report Suspicious Activity
    • School To Career
    • Spartan Headquarters
    • Special Education
    • Sports
      • Boys Teams
        • Baseball
        • Basketball
        • Football
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Swimming
        • Tennis
      • Coed Teams
        • Cross Country
        • Track & Field
        • Wrestling
      • Girls Teams
        • Basketball
        • Dance
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Softball
        • Swimming
        • Tennis
        • Volleyball
      • 24-25 Sport Registration-Athletic Code Video
      • Athletic & Activity Code of Conduct
      • Concussion & Sudden Cardiac Arrest Info
      • Infinite Campus Sport Registration Info Sheet
      • Parent Resources
      • Parent Transportation Form
      • Spartan Sport Sponsors
      • Uniform Care Info
      • WIAA Medical Eligibility Form
    • Staff Directory
    • Student Services
      • Transcript Request (former students)
    • Xello - Student
    • Web Design 1
      • Class Lessons
        • XHTML Tutorial
        • CSS Tutorial
        • Form Tutorial
        • Graphics
        • Dreamweaver
        • QuickMenu
        • Joomla!
      • Assignments
        • Site 1: Biography
        • Site 2: Fan Club
        • Site 3: Mixed Media
        • Site 4: Joomla!
      • Student Samples
        • Biography Sites
        • Fan Club Sites
        • Mixed Media Sites
        • Joomla! Sites
      • Helpful Sites
        • XHTML Help
        • CSS Help
        • Validation
        • QuickMenu
        • Joomla! Help
    • Web Design 2
      • Class Lessons
        • JavaScript Tutorial
        • PHP Tutorial
        • MySQL Tutorial
        • Admin - CMS
      • Assignments
        • Using JavaScript
        • For the Birds
      • Helpful Sites
        • JavaScript Tutorials
        • RegExp Help
        • Web Page Validation
    • Programming 1
      • Class Lessons
        • CLASS SET-UP
        • Logic Test
        • Class Preparation
        • Using BlueJ
        • --------------------
        • SET 1 LESSONS:
        • Printing
        • Variables
        • User Input
        • Random Number
        • Arithmetic
        • --------------------
        • SET 2 LESSONS:
        • If
        • Switch
        • --------------------
        • SET 3 LESSONS:
        • Looping
        • --------------------
        • SET 4-5 LESSONS:
        • Arrays
        • --------------------
        • SET 6 LESSONS:
        • String Manipulation
      • Problem Sets
        • Set 1: Basic Skills
        • Set 2: If & Switch
        • Set 3: Loops
        • Project: Craps
        • Set 4: Single Array
        • Set 5: Double Array
        • Set 6: Strings
      • Solution Sets
        • Problem Set 1
        • Problem Set 2
        • Problem Set 3
        • Problem Set 4
        • Problem Set 5
        • Problem Set 6
      • Helpful Sites
    • Programming 2
      • Class Lessons
        • Using BlueJ
        • What is an Object?
        • What is a Class?
        • GUI Programming
      • Problem Sets
        • Set 1 - Shapes
        • Set 2 - Exercises
        • Set 3 - Exercises
        • Set 4 - Exercises
        • Project - Adding
        • Set 5 - GUI by Hand
        • Project - NetBeans
        • Set 6 - NetBeans
        • Project - Life
        • Project - Slide Puzzle
        • Project - Matching
      • Solution Sets
        • Problem Set 1 (none)
        • Problem Set 2 (none)
        • Problem Set 3 (none)
        • Problem Set 4
    • McFarland High School
    • Academic & Career Planning (ACP)
      • Youth Apprenticeship
    • Athletic & Activity Code of Conduct
    • Canvas Login
    • Clubs
    • Communications
    • Course Supply List
    • Daily Announcements
    • Daily Schedules
    • Family Handbook
    • Grading Handbook
    • Graduation Information
    • Library Media Services
    • Music
    • Office Staff
    • PBIS
    • Portfolio Resources
    • Progressive Behavior Response Plan
    • Report Suspicious Activity
    • School To Career
    • Spartan Headquarters
    • Special Education
    • Sports
      • Boys Teams
        • Baseball
        • Basketball
        • Football
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Swimming
        • Tennis
      • Coed Teams
        • Cross Country
        • Track & Field
        • Wrestling
      • Girls Teams
        • Basketball
        • Dance
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Softball
        • Swimming
        • Tennis
        • Volleyball
      • 24-25 Sport Registration-Athletic Code Video
      • Athletic & Activity Code of Conduct
      • Concussion & Sudden Cardiac Arrest Info
      • Infinite Campus Sport Registration Info Sheet
      • Parent Resources
      • Parent Transportation Form
      • Spartan Sport Sponsors
      • Uniform Care Info
      • WIAA Medical Eligibility Form
    • Staff Directory
    • Student Services
      • Transcript Request (former students)
    • Xello - Student
    • Web Design 1
      • Class Lessons
        • XHTML Tutorial
        • CSS Tutorial
        • Form Tutorial
        • Graphics
        • Dreamweaver
        • QuickMenu
        • Joomla!
      • Assignments
        • Site 1: Biography
        • Site 2: Fan Club
        • Site 3: Mixed Media
        • Site 4: Joomla!
      • Student Samples
        • Biography Sites
        • Fan Club Sites
        • Mixed Media Sites
        • Joomla! Sites
      • Helpful Sites
        • XHTML Help
        • CSS Help
        • Validation
        • QuickMenu
        • Joomla! Help
    • Web Design 2
      • Class Lessons
        • JavaScript Tutorial
        • PHP Tutorial
        • MySQL Tutorial
        • Admin - CMS
      • Assignments
        • Using JavaScript
        • For the Birds
      • Helpful Sites
        • JavaScript Tutorials
        • RegExp Help
        • Web Page Validation
    • Programming 1
      • Class Lessons
        • CLASS SET-UP
        • Logic Test
        • Class Preparation
        • Using BlueJ
        • --------------------
        • SET 1 LESSONS:
        • Printing
        • Variables
        • User Input
        • Random Number
        • Arithmetic
        • --------------------
        • SET 2 LESSONS:
        • If
        • Switch
        • --------------------
        • SET 3 LESSONS:
        • Looping
        • --------------------
        • SET 4-5 LESSONS:
        • Arrays
        • --------------------
        • SET 6 LESSONS:
        • String Manipulation
      • Problem Sets
        • Set 1: Basic Skills
        • Set 2: If & Switch
        • Set 3: Loops
        • Project: Craps
        • Set 4: Single Array
        • Set 5: Double Array
        • Set 6: Strings
      • Solution Sets
        • Problem Set 1
        • Problem Set 2
        • Problem Set 3
        • Problem Set 4
        • Problem Set 5
        • Problem Set 6
      • Helpful Sites
    • Programming 2
      • Class Lessons
        • Using BlueJ
        • What is an Object?
        • What is a Class?
        • GUI Programming
      • Problem Sets
        • Set 1 - Shapes
        • Set 2 - Exercises
        • Set 3 - Exercises
        • Set 4 - Exercises
        • Project - Adding
        • Set 5 - GUI by Hand
        • Project - NetBeans
        • Set 6 - NetBeans
        • Project - Life
        • Project - Slide Puzzle
        • Project - Matching
      • Solution Sets
        • Problem Set 1 (none)
        • Problem Set 2 (none)
        • Problem Set 3 (none)
        • Problem Set 4

Problem 1
public void between1And100()
{
  int num1;
  System.out.print("Enter a number from 1 to 100: ");
  num1=in.nextInt();
  if (1<=num1 & num1<=100)
    System.out.print("That number is valid.");
  else
    System.out.print("That number is not valid.");
}

 


Problem 2
public void compareNumbers()
{
int num1, num2;
System.out.print("Enter a number: ");
num1=in.nextInt();
System.out.print("Enter another number: ");
num2=in.nextInt();
if (num1>num2)
System.out.print(num1+" is greater than "+num2);
else if(num1<num2)
System.out.print(num1+" is less than "+num2);
else
System.out.print("The numbers are equal.");
}

 


Problem 3
public void oddOrEven()
{
int ran1, remain;
ran1=(int)(Math.random() *10)+1;
System.out.println("The number chosen by the computer is "+ran1);
remain=ran1%2;
if(remain==0)
System.out.print(ran1+" is an even number.");
else
System.out.print(ran1+" is an odd number.");
}

 


Problem 4
public void temp()
{
double temp;
System.out.print("Enter the current temperature (Fahrenheit): ");
temp=in.nextDouble();
if(temp<60)
System.out.print("Wear a coat today.");
else
System.out.print("Have a nice day.");
}

 


Problem 5
public void temp()
{
double temp;
System.out.print("Enter the current temperature (Fahrenheit): ");
temp=in.nextDouble();
if(temp<60 &&temp>=40)
System.out.print("Wear a coat today.");
else if(temp>=90)
System.out.print("Wear your bathing suit.");
else if(temp>=60& temp<90)
System.out.print("Have a nice day.");
else
System.out.print("Wear your winter coat.");
}

 


Problem 6
public void squareArea()
{
int num1, area;
System.out.print("Enter a positive whole number: ");
num1=in.nextInt();
area=num1*num1;
if (num1>=1)
System.out.print("The area of the square is "+area+" units.");
else
System.out.print("Invalid entry.");
}

 


Problem 7
public void rectangleArea()
{
int num1, num2, area;
System.out.print("Enter a positive integer: ");
num1=in.nextInt();
System.out.print("Enter another positive integer: ");
num2=in.nextInt();
area=num1*num2;
if (num1>=1 && num2>=1)
System.out.print("The area of the rectangle is "+area+" square units.");
else if(num1>=1 && num2<=0)
System.out.print("There is one invalid integer.");
else if(num1<=0 && num2>=1)
System.out.print("There is one invalid integer.");
else
System.out.print("The numbers entered are invalid.");
}

 


Problem 8
public void calcDiscriminant()
{
int a, b, c, answer;
System.out.print("Enter a value for a: ");
a=in.nextInt();
System.out.print("Enter a value for b: ");
b=in.nextInt();
System.out.print("Enter a value for c: ");
c=in.nextInt();
answer=(b*b)-(4*a*c);
if (answer>=1)
System.out.print("a= "+a+", b= "+b+", c= "+c+", the discriminant= "+answer+" and has Two Roots.");
else if(answer<=-1)
System.out.print("a= "+a+", b= "+b+", c= "+c+", the discriminant= "+answer+" and has No Roots.");
else
System.out.print("a= "+a+", b= "+b+", c= "+c+", the discriminant= "+answer+" and has One Roots.");
}

 


Problem 9

public void calcGrade()
{
int grade;
System.out.print("Enter a grade (0-100): ");
grade=in.nextInt();
if (grade<60)
  {
   System.out.println("The grade you entered was "+grade);
   System.out.print("You have earned a letter grade of F.");
   }
else if (grade>=60&&grade<=69)
  {
   System.out.println("The grade you entered was "+grade);
   System.out.print("You have earned a letter grade of D.");
  }
else if (grade>=70&&grade<=79)
  {
   System.out.println("The grade you entered was "+grade);
   System.out.print("You have earned a letter grade of C.");
   }
else if (grade>=80&&grade<=89)
  {
   System.out.println("The grade you entered was "+grade);
   System.out.print("You have earned a letter grade of B.");
  }
else
  {
   System.out.println("The grade you entered was "+grade);
   System.out.print("You have earned a letter grade of A.");
  }
}

 


Problem 10
public void calcGrade()
{
int grade;
System.out.print("Enter a grade (0-100): ");
grade=in.nextInt();
if (grade<60)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of F.");
}
else if (grade>=60&&grade<=63)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of D-.");
}
else if (grade>=64&&grade<=66)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of D.");
}
else if (grade>=67&&grade<=69)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of D+.");
}
else if (grade>=70&&grade<=73)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of C-.");
}
else if (grade>=74&&grade<=76)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of C.");
}
else if (grade>=77&&grade<=79)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of C+.");
}
else if (grade>=80&&grade<=83)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of B-.");
}
else if (grade>=84&&grade<=86)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of B.");
}
else if (grade>=87&&grade<=89)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of B+.");
}
else if (grade>=90&&grade<=93)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of A-.");
}
else if (grade>=94&&grade<=96)
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of A.");
}
else
{
  System.out.println("The grade you entered was "+grade);
  System.out.print("You have earned a letter grade of A+.");
}
}
}

 


Problem 11
 public class Problem_11
{
public void packageCalc()
{
int length, width, height;
System.out.print("Enter a package length(cm): ");
length=in.nextInt();
System.out.print("Enter a package width(cm): ");
width=in.nextInt();
System.out.print("Enter a package height(cm): ");
height=in.nextInt();
if (length<=10 && height<=10 && width<=10)
System.out.print("Package Accepted.");
else
System.out.print("Package Rejected.");
}
}

 


Problem 12

 public class Problem_12
{
public void wageCalc()
{
double hour, rate, wage;
System.out.print("Enter the number of hours worked: ");
hour=in.nextDouble();
System.out.print("Enter the hourly rate: $");
rate=in.nextDouble();
if (hour<=40)
{
  wage=rate*hour;
  System.out.print("Wages earned= "+wage);
}
else
{
  wage=(hour-40)*rate*1.5+40*rate;
  System.out.print("Wages earned= "+wage);
}
}

 


Problem 13
public void calcPay()
{
double hours, rate, wage,tax;
String exempt;

System.out.print("Enter hours worked: ");
hours=in.nextDouble();

System.out.print("Enter hourly rate: $");
rate=in.nextDouble();

System.out.print("Exempt? (Y/N): ");
exempt=in.next();



if(hours<40 && exempt.compareToIgnoreCase("y")==0)
{
  wage=hours*rate;
  wage=Math.round(wage*100.0)/100.0;
  System.out.println("Wages earned= "+wage);
  System.out.print("No Taxes Deducted");
}
else if (hours<40)
{
  tax=hours*rate*.18;
  tax=Math.round(tax*100.0)/100.0;
  wage=(hours*rate)-tax;
  wage=Math.round(wage*100.0)/100.0;
  System.out.println("Wages earned= "+wage);
  System.out.print("Taxes deducted= "+tax);
}
else if (hours>40 && (exempt.compareToIgnoreCase("y")==0))
{
  wage=((hours-40) * 1.5 * rate)+(40*rate);
  wage=Math.round(wage*100.0)/100.0;
  System.out.println("Wages earned= "+wage);
  System.out.print("No Taxes Deducted");
}
else
{
  wage=((hours-40) * 1.5 * rate)+(40*rate);
  tax=wage*.18;
  wage=wage-tax;
  wage=Math.round(wage*100.0)/100.0;
  System.out.println("Wages earned= "+wage);
  System.out.print("Taxes deducted= "+tax);
}
}

 


Problem 14
public void nameCompare()
{
String name1, name2;
System.out.print("Enter a name: ");
name1=in.next();
System.out.print("Enter another name: ");
name2=in.next();

if(name1.compareTo(name2)< 0)
System.out.println(name1+" comes before "+name2+" alphabetically.");
else if(name1.compareTo(name2)>0)
System.out.println(name1+" comes after "+name2+" alphabetically.");
else
System.out.println("These names are the same. Nice one, Einstein.");
}

 


Problem 15
public void batMan()
{
String word;
System.out.print("Enter a word (first letter capitalized): ");
word=in.next();
if (word.compareTo("Bat")>0 && word.compareTo("Man")<0)
System.out.print("Is between.");
else
System.out.print("Is not between.");
}

 


Problem 16
public void vowelOrConsonant()
{
String letter;
System.out.print("Enter a letter: ");
letter=in.next();

if (letter.compareToIgnoreCase("A")==0||
letter.compareToIgnoreCase("E")==0||
letter.compareToIgnoreCase("O")==0||
letter.compareToIgnoreCase("U")==0||
letter.compareToIgnoreCase("I")==0)
System.out.print(letter+" is a vowel.");
else
System.out.print(letter+" is a consonant.");
}

 


Problem 17
public void fruit()
{
int num;
System.out.print("Enter a number from 1 to 5: ");
num=in.nextInt();
switch(num)
{
case 1:
System.out.println("You will eat a pomegranate.");
break;
case 2:
System.out.println("You will eat an orange.");
break;
case 3:
System.out.println("You will eat a banana.");
break;
case 4:
System.out.println("You will eat a peach.");
break;
case 5:
System.out.println("You will eat an apple.");
break;
default:
System.out.println("That is an invalid response.");
}
}

 

McFarland School District Home

McFarland School District

Grades: 9 - 12

Contact Information

  • McFarland High School (9-12)

    5103 Farwell Street
    McFarland, WI 53558
  • Phone

    608 838-3166
  • Fax

    608 838-4562

Social Media

  • McFarland School District Social Facebook
  • McFarland School District Social Instagram
McFarland School District Mark

© 2025 McFarland School District

  • Non-Discrimination Statement
CMS4Schools