Java

Good Essays
Java Problems

SEQUENCE PROBLEMS:

1. Create a Java program that will print the sum of two integers.
2. Print the sum and product of three integers.
3. Print the perimeter and area of a rectangle.
4. Given the number of a baseball team’s wins and losses, compute its winning percentage. Assume that there are no ties.
5. Input the number of a team’s wins, losses, and ties, and print its winning percentage. Assume that a tie game counts as a full game played and a half-game won.
6. Given the list price of an item and the rate of discount, print the amount of the discount and the net price.
7. Given the list and net prices of an item, find the amount of discount and the percent (rate) of discount.
8. Input the total amount of a sales and the sales tax rate, find the amount of tax and the net sale after taxes.
9. The withholding tax on a weekly salary (let us assume) is computed as follows: 14% of the difference between a person's gross pay and $13 times the number of dependents he or she claims. Read the values for the gross pay and the number of dependents; print the withholding tax.
10. Input the amount of food ordered and then output the amount to be paid when a sales tax of 4% is to be added to the cost.
11. Employees at a certain company have won a 6.5% pay increase. Input the old salary and then output his new salary.
12. Input your height in feet and then convert it to inches and centimeters.
13. Input the length of a side of a square and then output its perimeter and area.
14. Input the price of an item bought at sale. Subtract 20% from the original price and print the new price.
15. Input the price of an apple bought at a store and its rate of discount and then output the amount of discount and the net price.
16. A flower shop sells roses for P50 each, orchids for P80 each, and tulips for P90 each. Write a Java program that would input the number of roses, orchids, and tulips a customer bought and output the total cost.

Java PROBLEMS:

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Java

    • 1218 Words
    • 5 Pages

    without any errors. . Copyright Reserved. Mohd Fadzli Marhusin. 3 Computer Instruction : Cont’ You write a computer program using a high-level programming language, e.g. java. The java compiler and interpreter responsible to converting the code you write into form of on and off switches. When you execute a java program, the program is run within a contained environment…

    • 1218 Words
    • 5 Pages
    Satisfactory Essays
  • Better Essays

    JAVA

    • 956 Words
    • 4 Pages

    called Java and eventually in 1994 after the failure of Interactive TV Java project team switched their focus to the web. On May 23rd 1995 the director of Sun Microsystems along with co-founder and executive vice president Netscape announced to the world about the Java. There is only 30 pepole team when java was started. Development of java has taken step by step process. There are many versions in Java like Versions 1.0 and 1.1 are the initial release of Java. Java 2 (Version 1.2), Kestrel (Java 1.3)…

    • 956 Words
    • 4 Pages
    Better Essays
  • Good Essays

    Java

    • 34590 Words
    • 158 Pages

    Java 2 ™ FOR DUMmIES ‰ 2ND by Barry Burd EDITION Java 2 For Dummies, 2nd Edition Published by Wiley Publishing, Inc. 111 River Street Hoboken, NJ 07030-5774 Copyright © 2004 by Wiley Publishing, Inc., Indianapolis, Indiana Published by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying…

    • 34590 Words
    • 158 Pages
    Good Essays
  • Good Essays

    Java

    • 5076 Words
    • 21 Pages

    Java Software Solutions: Foundations of Program Design, 6e (Lewis/Loftus) Chapter 1 Introduction Multiple-Choice Questions 1) A Java program is best classified as A) hardware B) software C) storage D) processor E) input Answer: B 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. 2) 6 bits can be…

    • 5076 Words
    • 21 Pages
    Good Essays
  • Satisfactory Essays

    Java

    • 473 Words
    • 2 Pages

    OOP2: Object Oriented Programming 2 (Java) Jocel L. Garrido,CCNA Object Oriented Programming 2 (Java) Instructor: Jocel L. Garrido Classes 3 Parts: -Class Name -Attributes -Functions or methods class Reading_Material public class Reading_Material { public class Reading_Material { private String Title, Publisher; private int date_published, current_page; public int get_page() { return current_page; } -Title -Publisher -date_published -current_page private String Title, Publisher;…

    • 473 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Java

    • 3153 Words
    • 13 Pages

    subject matter, subject landscape, or even world view. This transformation may be sudden or it may be protracted over a considerable period, with the transition to understanding proving troublesome ” (H.F. Meyer and R Land, 2006, p.3). An example in Java programming, the array is the accepted standard to store more than one variable, it is virtually practised universally. But the concept, when grasped, tends to be “ritual knowledge” (Perkins 1999). It doesn’t have to be understood, one just has…

    • 3153 Words
    • 13 Pages
    Powerful Essays
  • Good Essays

    Java

    • 490 Words
    • 3 Pages

    Write a Java program to demonstrate using bitmaps and bitwise operators to sort and remove duplicates from a file of random phone numbers. Do not confuse the term bitmap used for compressing data into smaller spaces with the bitmap that has come to mean a graphic image. You will use this file of 4 million random phone numbers with possible repeats in args[0]. In addition, will be given an output filename provided inargs[1] into which you will write the sorted list of phone numbers without duplicates…

    • 490 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Java

    • 472 Words
    • 2 Pages

    Java technology is a high-level programming and a platform independent language. Java is designed to work in the distributed environment on the Internet. Java has a GUI features that provides you better "look and feel" over the C++ language, moreover it is easier to use than C++ and works on the concept of object-oriented programming model. Java enable us to play online games, video, audio, chat with people around the world, Banking Application, view 3D image and Shopping Cart. Java find its extensive…

    • 472 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    java

    • 258 Words
    • 2 Pages

    OverviewPackageClassUseTreeDeprecatedIndexHelp Java™ Platform Standard Ed. 7 Prev ClassNext ClassFramesNo FramesAll ClassesSummary: Nested | Field | Constr | MethodDetail: Field | Constr | Method java.util Class Scanner java.lang.Object java.util.Scanner All Implemented Interfaces: Closeable, AutoCloseable, Iterator public final class Scanner extends Object implements Iterator, Closeable A simple text scanner which can parse primitive types and strings using regular expressions. A…

    • 258 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Java

    • 1389 Words
    • 6 Pages

    Java Language Programming Basic Programming Elements Tiberiu Leţia: Software Engineering –Java Programming Language – Programming Basic Elements 1 Content 1. Stand alone applications and mini-applications 2. Name and identifiers 3. Java program structure 4. Data types 5. Operators 6. Flow execution control Tiberiu Leţia: Software Engineering –Java Programming Language – Programming Basic Elements 2 1. Stand alone applications and mini-applications Mini- applications = applets…

    • 1389 Words
    • 6 Pages
    Powerful Essays