Preview

Hw java

Satisfactory Essays
Open Document
Open Document
416 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Hw java
Department of Information Science, College for Women, Kuwait University

ICS 240 – Fall 2008-09
Home Works #1

1. Write a program that prompts the user to input the length and width of a rectangle and then prints the rectangle’s area and perimeter.

2. Write a program that does the following:
a) Prompts the user to input five decimal numbers
b) Prints the five decimal numbers
c) Converts each decimal number to the nearest integer
d) Adds the five integers
e) Prints the sum and average of the five integers

3. To make profit, a local store marks up the prices of its items by a certain percentage. Write a Java program that reads the original price of the item sold, the percentage of the marked-up price, and sales tax rate. The program then outputs the original price of the item, the mark-up percentage of the item, the store's selling price of the item, the sales tax rate, the sales tax, and the final price of the item. ( the final price of the item is the selling price plus the sales tax.)

4. The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets—box, sideline, premium, and general admission. After each game, the data is stored in a file in the following form: ticketPrice numberOfTicketsSold

Sample data are shown below:
250 5750
100 28000
50 35750
25 18750
The first line indicates that the box ticket price is $250 and that 5750 tickets were sold at that price. Output the number of tickets sold and the total sale amount. Format your output with two decimal places.

5. Write a program to calculate the property tax. Property tax is calculated on 92% of the assessed value of the property. Foe example, if the assessed value is $100000, the property tax is on $92000. Assume that the property tax rate is $1.05 for each $100 of the assessed value. Your program should prompt the user to enter the assessed value of the property. Store the output in

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Hsm 260 Week 4 Case Study

    • 660 Words
    • 3 Pages

    Sales revenue | $580,000 | $600,000 | $20,000 | U | Cost of goods sold | $385,000 | $360,000 | $25,000 | F |…

    • 660 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Mat 540 Assignment 1

    • 1196 Words
    • 5 Pages

    This causes the shape of the box plot to be quite spread out with the median and quartiles close together. The female writing hand box plot is also the same length as the writing hand box plot; this is because the minimum and maximum data from the writing hand came from females. When putting the male and female writing hand box plots in comparison to each other, you can see that females have a much larger range than the males as discussed before. This causes the female box plot to have a lower, lower quartile and median and a higher upper quartile. The median for males is only slightly higher than the median for females, keeping in mind that males had data from an eleven (11) year old and females had data from a forty two (42) year old. This can cause the data to be slightly swayed as there were not equal age groups for both box…

    • 1196 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    2. The program will display a series of screens prompting the user to enter the item name or number, price and quantity.…

    • 498 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    ops335 lab 2 firewall

    • 695 Words
    • 4 Pages

    4. Enter the list price of the book and include a dollar sign in the prompt. Make the list price a decimal data type or test to ensure that the user entered a numerical value.…

    • 695 Words
    • 4 Pages
    Good Essays
  • Good Essays

    CIS115 W2 Exercise

    • 757 Words
    • 10 Pages

    Your goal is to solve the following simple programming exercise. You have been contracted by a local stadium to design an algorithm determining the total seating charges for any game held at the stadium. Lower level seats cost $25 per seat, midlevel seats cost $15 per seat, and upper level seats cost $10 per seat. The algorithm should ask the user for the number of seats being purchased in each seating level. Then, the algorithm will determine the total for each level and a grand total for the entire purchase.…

    • 757 Words
    • 10 Pages
    Good Essays
  • Good Essays

    Sales and Cell

    • 445 Words
    • 2 Pages

    In this project, you will create a worksheet that calculates sales and commissions for a used car company. You will create functions that determine monthly payments, lookup commission rates, and calculate a bonus for the salespeople.…

    • 445 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    15.Write a program that will prompt the user to enter a hex digit character (0...9 or…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 week 2

    • 320 Words
    • 3 Pages

    A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6 percent.…

    • 320 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Cost Control Problem Set

    • 689 Words
    • 3 Pages

    Menu item |Number sold |Standard/budgeted portion cost | |A |580 |$4.45 | |B |285 |$6.20 | |C |600 |$4.15 | |D |200 |$6.00 | |E |475 |$5.95 | |F |320 |$7.05 | |G |545 |$6.10 | |H |200 |$6.95 | |Totals |3,205 | | | | | | |Solve all problems for 2 decimal places (x.xx) | | | |Food sales |$57,680.30 | | | | | | |1. Food cost $ based on standard cost figures |$17834.75 |(1 pt) | | | | | |2. Food cost % based on standard cost figures |30.92% |(1 pt) | | | | | |3. Contribution margin $ |$39845.55 |(1 pt) | | | | | |Actual inventory figures | | | |Opening inventory |$6,415.60 | | |Purchases |$19,950.30 | | |Ending inventory |$6,852.65 | | | | | | |4. Cost of goods sold $ |$19513.25 |(1 pt) | | | | | | | | | |5. Food cost % based on actual cost figures |33.83% |(1 pt) | | | | | | | | | |6. Difference between standard and actual cost in $ |+1678.5 |(1 pt) + or | | | | | |7. Difference between standard and actual cost % |+2.91% |(1 pt) + or | |…

    • 689 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Yorktown Technology

    • 483 Words
    • 2 Pages

    After finding the price the company wanted to find the revenue. The formula for revenue is {R(x) =xp}.The x in xp stands for the number of retailors that are likely to buy at their set price per seat. With that given we know the formula for price; therefore we have to write the new equation like {R(x) = x(100-25x)}. After writing out the first equation\ is to distribute. The equation for revenue now would end up looking like Rx= 100x-25(squared). After finding the formula for the revenue the next thing the…

    • 483 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    unit 3

    • 313 Words
    • 2 Pages

    Design a program that calculates the total amount of meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 15% tip and 7% sales tax. Display each of these amounts and the total.…

    • 313 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    5.) Design a While loop that lets the user enter a number. The number should be multiplied by 10, and the result stored in a variable named product. The loop should stop once product contains a value > 100.…

    • 651 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    formulas to have Excel calculate the profits for all 3 ticket prices and the number…

    • 268 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    To get the Total Sales of each item is to multiply the volume and the selling price like for the computer paper: 3,000 x 14 = 420,000. To get the Material cost, have to multiply the volume and the material cost of each item and like for the computer paper: 3,000 x 6 = 180,000. Lastly, to get the total Variable overheads, would have to multiply the Variable Overhead per unit by the volume like for the computer paper: 1.5 x 3,000 = 45,000. For the Grand Total Sales is to add all the Total Sales of each item: $420,000 + $840,000 + $540,000 + $680,000 = $2,480,000. In order to get the Contribution Margin, for an example for the computer paper:…

    • 983 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Death Penalty Reform

    • 704 Words
    • 3 Pages

    There’s a saying that two wrongs don’t make a right. According to the DPIC (Death Penalty…

    • 704 Words
    • 3 Pages
    Good Essays