Preview

Java Progamming

Good Essays
Open Document
Open Document
7830 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Java Progamming
yet another insignificant programming notes... | HOME
TABLE OF CONTENTS (HIDE)
1. Exercises on Flow Controls
1.1 Exercises on Conditional (Decision)
1.2 Exercises on Loop (Iteration)
1.3 Exercises on Nested-Loop
2. Exercises on Keyboard and File Input
3. Exercises on User Input and String Operations
4. Exercises on Array
5. Exercises on Command-line Arguments
6. Exercises on Method
7. More (Difficult) Exercises
8. Exercises on Number Theory
Java Programming Tutorial
Exercises on Java Basics
-------------------------------------------------
1. Exercises on Flow Controls
-------------------------------------------------
1.1 Exercises on Conditional (Decision)
Exercise CheckPassFail (if-else): Write a program called CheckPassFail which prints "PASS" if the int variable "mark" is more than or equal to 50; or prints "FAIL" otherwise.
Hints:
------------------------------------------------- public class CheckPassFail { // saved as "CheckPassFail.java"
-------------------------------------------------
public static void main(String[] args) {
-------------------------------------------------
int mark = 49; // set the value of mark here!
-------------------------------------------------
System.out.println("The mark is " + mark);
-------------------------------------------------

------------------------------------------------- if ( ...... ) {
-------------------------------------------------
System.out.println( ...... );
-------------------------------------------------
} else {
-------------------------------------------------
System.out.println( ...... );
-------------------------------------------------
}
-------------------------------------------------
}

You May Also Find These Documents Helpful

  • Better Essays

    Jdt2 Task 1

    • 1786 Words
    • 8 Pages

    | Per your request to investigate and recommend Toy Company’s position regarding Claim #1-2013; this report was generated. The initial research has been finalized and recommendations determined. I will refer to the claim by its number #1-2013 and the claimant as AA23 to keep the confidentiality of the claimant. First this report will provide a summary of the claim and the history associated with it. Second it will discuss the definition of Constructive Discharge and its relevance to this claim. Third it will provide the specific areas under the Title VII of the Civil Rights Act of 1964. Fourth it will offer recommendations and supporting legal references. Fifth it will recommend proactive steps to avoid future legal issues in relationship to the Title VII of the Civil Rights Act of 1964. And finally any references used in this research will be provided. A. Definition of Constructive DischargeSummary of Claim and history:In January 1, 2013 a new policy was implemented to support exponential company growth. This policy impacted all production employees. The impacted employees were notified of the changes two months in advance of the January 2013 implementation to allow for assimilation and training on the new shifts schedules and there impacts. Production employee schedules were shifted from a Monday through Friday schedule, 8 hour shift to a Monday through Sunday schedule, 12 hour shift, four working days can occur any day of the week. This schedule requires all production employees to work on holy days regardless of religious affiliation as the production now runs seven days a week.Office staff members were not impacted by this policy change.AA23 quit on January 2, 2013 after new policy was in effect.…

    • 1786 Words
    • 8 Pages
    Better Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    9.Write a program to count the number of characters in an input line. Page: 105…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    JDT2 Task 3

    • 2402 Words
    • 8 Pages

    Higher employee satisfaction – When an appraisal is exquisitely prepared and well delivered employees are prone to respond better to the feedback presented. The employees also come away from the meeting with a clear understanding of their performance and where improvement is needed. They will also have good understanding of the company’s goals both for itself and for the employee themselves.…

    • 2402 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    Lab 3 Student

    • 1264 Words
    • 7 Pages

    Step 1: This program is most easily solved using just a few variables. Identify potential problems with the following variables declared in the pseudocode. Assume that the college has the ability to offer half credits. (Reference: Variable Names, page 39-40).…

    • 1264 Words
    • 7 Pages
    Satisfactory Essays
  • Good Essays

    Java

    • 5076 Words
    • 21 Pages

    Explanation: B) Programs are classified as software to differentiate them from the mechanisms of the computer (hardware). Storage and the processor are two forms of hardware while input is the information that the program processes.…

    • 5076 Words
    • 21 Pages
    Good Essays
  • Good Essays

    Programming

    • 3038 Words
    • 13 Pages

    2. Each of the flowchart segments in Figure 3-35 is unstructured. Redraw each flowchart segment so that it does the same thing but is structured.…

    • 3038 Words
    • 13 Pages
    Good Essays
  • Satisfactory Essays

    Homework CH 1 Java

    • 723 Words
    • 5 Pages

    2. Languages that let you use a vocabulary of descriptive terms, such as read, write, or…

    • 723 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    Comparing Primitives vs Comparing Strings There is a difference Comparing Primitives • Primitives are compared with an operator: = = < <= > >= ! = //given…

    • 464 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    programiing

    • 923 Words
    • 4 Pages

    7: Write a program that requests two floating-point numbers and prints the value of their difference divided by their product. Have the program loop through pairs of input values until the user enters nonnumeric input.…

    • 923 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    3. Prompt the user for a number and print good if the number is greater than 5, between 8 & 10 or greater than 33. Otherwise, print bad. Use the || operator in your if statement.…

    • 693 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    1. Write a program in Java that allows the user to enter a number and then display its Pascal’s Triangle -The triangle is bordered by ones on the right and left sides, and each interior entry is the sum of the two entries above.…

    • 1391 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    java

    • 312 Words
    • 2 Pages

    AllocationStrategy.java import java.util. ArrayList; import java.util. Collection; import java.util. Iterator; import java.util. List; import java.util.…

    • 312 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Java

    • 2071 Words
    • 9 Pages

    The Next Gen IT Trends & Web Technologies – Course Plan - Version 1.1 is released for…

    • 2071 Words
    • 9 Pages
    Powerful Essays
  • Satisfactory Essays

    Java Calculator CMD

    • 889 Words
    • 4 Pages

    import java.util. *; class pup { public static void main (String [] args) { int a,b,op; int c = 0; Scanner fSC = new Scanner(System.in); System.out.println("Welcome to CMD basic calculator!\n"+"Press ENTER key to continue . . ."); Scanner aKey = new Scanner(System.in); String akeyp = aKey.nextLine(); System.out.println("Enter first number:"); a = fSC.nextInt(); System.out.println("Input operator to be used( Ex. 1):\n"+"1. Addition\n"+"2. Subtraction\n"+"3. Multiplication\n"+"4.…

    • 889 Words
    • 4 Pages
    Satisfactory Essays
  • Powerful Essays

    Computer Java

    • 1329 Words
    • 6 Pages

    1. Object Orientd Prrogramming : A type of programming in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. In this way, the data structure becomes an objectthat includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects.…

    • 1329 Words
    • 6 Pages
    Powerful Essays