King Saud University College Of Computer And Information Sciences Information

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View King Saud University College Of Computer And Information Sciences Information as PDF for free.

More details

  • Words: 340
  • Pages: 2
King Saud University College of Computer and Information Sciences Information Technology Department First Semester 1430/143129 CSC 111: Introduction to Programming with Java TUTORIAL # 1 Chap1: Problem-solving Give the algorithm or draw the flowchart for the following problems Exercise#1 Write a program that finds the smallest of several integers. Assume that the first value read specifies the number of values remaining. Exercise#2 Write a program that calculates and prints the sum of the even integers from 2 to 30. Exercise#3 A mail order house sells five different products whose retail prices are shown in the following table Product number Retail price 1 $2.98 2 $4.50 3 $9.98 4 $4.49 5 $6.87 Write a program that reads a series of pairs of numbers as follows: • Product number • Quantity sold for one day Your program should determine the retail price for each product. Your program should calculate and display the total retail value of all products sold last week.

1

Exercise#4 Calculate the value of π from the infinite series π = 4 – 4/3 + 4/5 – 4/7 + 4/9 – 4/11 +… Print a table that shows the value of π approximated by one term of this series by two terms, by three terms, etc… Exercise#5 Your company pays its employees time and a half for all hours worked over 40 hours a weekd. Employees who earn more than $100.00 a week pay union dues of $25 per week. Write a program to compute an employee's gross pay and net pay. Exercise#6 Write a program that determines the additional state tax owed by an employee. The state charges a 4% tax on net income. Determine net income by subtracting a $500 allowance for each dependent from gross income. Your program will read gross income, number of dependents, and tax amount already deducted. It will then compute the actual tax owed and print the difference between tax owed and tax deducted followed by the message 'SEND CHECK' or 'REFUND', depending on whether the difference is positive or negative.

2

Related Documents