Practice2_2629 - German University in Cairo Faculty of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
German University in Cairo Faculty of Media Engineering and Technology Prof. Dr. Slim Abdennadher Introduction to Computer Science , Winter Term 2009-2010 Practice Assignment 2 Discussion: 17.10.2009 - 22.10.2009 Exercise 2-1 Discount A discount is made on a purchase as follows: if purchase 1000 L.E., there is no discount if purchase > 1000 L.E., the discount is 5% Given the cost of the purchase, write an algorithm to calculate and print the money paid taking into consideration the 10% sales taxes. Exercise 2-2 Gas Station National Last Chance gas station sits on Cairo Alexandria route. There is no other gas station for 200 Miles. Write an algorithm to help drivers decide if they need gas or not. The user will enter: The capacity of the gas tank, in Gallons. The indication of the gas gauge in percent (full=100, three quarters=75 and so on). The miles per gallon of the car. The following is a sample run of the algorithm:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Practice2_2629 - German University in Cairo Faculty of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online