Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6059037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:39:58+00:00 2026-05-23T08:39:58+00:00

Please help with my assignment. Here is the question: Create a separate test driver

  • 0

Please help with my assignment. Here is the question:

Create a separate test driver class
called TestEmployeePayroll that will
test the EmployeePayroll class by
performing the following:

Prompt the user to enter the
employees’ ID number, First name, Last
name, Pay Category and Hours worked
(one at a time).

  • The user entry for employees ID
    number must be exactly 5 digits long.
  • The user entry for Category must only
    be accepted if it is in the range 1
    to 4.
  • The user entry for Hours worked
    must only be accepted if it is the
    range 1 to 80.

This is what I did till now:

import java.util.Scanner;
public class TestEmployeePayRoll {

    public static void main(String[] args){
        EmployeePayRoll obj1 = new EmployeePayRoll();

        Scanner input = new Scanner(System.in);
        System.out.println("Enter the Employee ID number: "+ " ");
        String EmployeeID = input.nextLine();

        //How to check the range here if int is 5 digits long or not ?

        System.out.println("Enter the first Name: "+ " ");
        String FirstName =  input.nextLine();

        System.out.println("Enter Last Name: "+ " ");
        String LastName = input.nextLine();

        System.out.println("Enter the Pay Category: "+ " ");
        double PayCategory = input.nextDouble();

        System.out.println("Enter the number of hours worked: "+ " ");
        double HoursWorked = input.nextDouble();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:39:58+00:00Added an answer on May 23, 2026 at 8:39 am

    You can count the length of a String and then convert it to number, Oli Charlesworth told you how to convert it, or you can measure the number. It depends on what you want. Is 012345 a valid ID? It’s a 6 char String but it is less than the biggest 5 digits number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please help, I am stuck here --- irb> a = line of text\n line
Hi Guys could you please help me refactor this so that it is sensibly
Greetings everyone. This is my first question here at stackoverflow so please bear with
I have an assignment said that to create a findString function that accept 2
Please help! I got very frustrated with this assignment to demonstrate Apache and Java
Please help! I'm really at my wits' end. My program is a little personal
Please help! Background info I have a WPF application which accesses a SQL Server
Please help me with a sanity check. Assuming a many-to-many relationship: Post, PostTagAssoc, Tag
Please help! I couldn't figure it out how to map the following situation: I
Please help us settle the controversy of Nearly everything is an object ( an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.