فزعتكم يا شباب 103

الموضوع في 'علوم الحاسب الآلي' بواسطة شيراتون, بتاريخ ‏6 ابريل 2014.

  1. شيراتون

    انضم:
    ‏24 يوليو 2011
    المشاركات:
    1,425
    التخصص:
    هندسة الطيران و الفضاء
    الجامعة:
    جامعة الملك فهد للبترول و المعادن
    سنة التخرج:
    2018
    نقاط الجائزة:
    0
    الجنس:
    ذكر
    التقييمات:
    +17 / 0 / -0
    تكفون فزعتكم بهالسؤال الله يجزاكم خير

    InternetLite Corporation is an Internet service provider that charges customers a flat rate
    of $7.99 for up to 10 hours of connection time. Additional hours or partial hours are
    charged at $1.99 each. Write a function charge that computes the total charge for a
    customer based on the number of hours of connection time used in a month. The function
    should also calculate the average cost per hour of the time used (rounded to the nearest
    cent), so use two output parameters to send back these results. Write a second function
    round_money that takes a real number as an input argument and returns as the function
    value the number rounded to two decimal places. Use this function for rounding the
    average cost per hour of the time used to the nearest cent. Write a main function that
    takes data from an input file usage.txt and produces an output file charges.txt. Your
    program should handle an input file of any size. The data file format is as follows:
    Line 1: current month and year as two integers
    Other lines: customer number (a 5-digit number) and number of hours used
    Here is a sample data file and the corresponding output file:

    Data file usage.txt
    10 2009
    15362 4.2
    42768 11.1
    11111 9.9

    Output file charges.txt
    Charges for 10/2009

    Customer Hours used Charge Average cost
    15362 4.2 7.99 1.90
    42768 11.1 11.97 1.08
    11111 9.9 7.99 0.81
     
  2. شيراتون

    انضم:
    ‏24 يوليو 2011
    المشاركات:
    1,425
    التخصص:
    هندسة الطيران و الفضاء
    الجامعة:
    جامعة الملك فهد للبترول و المعادن
    سنة التخرج:
    2018
    نقاط الجائزة:
    0
    الجنس:
    ذكر
    التقييمات:
    +17 / 0 / -0
    وينكم يا اخوان ؟؟
     
  3. شيراتون

    انضم:
    ‏24 يوليو 2011
    المشاركات:
    1,425
    التخصص:
    هندسة الطيران و الفضاء
    الجامعة:
    جامعة الملك فهد للبترول و المعادن
    سنة التخرج:
    2018
    نقاط الجائزة:
    0
    الجنس:
    ذكر
    التقييمات:
    +17 / 0 / -0
    تكفون بسرعة ترا اليوم الدد لاين
     
جاري تحميل الصفحة...
مواضيع شبيهة - فزعتكم يا شباب 103
  1. Saad Khalid
    الردود:
    3
    المشاهدات:
    1,612
  2. maitham18
    الردود:
    0
    المشاهدات:
    879
  3. Golden-00
    الردود:
    12
    المشاهدات:
    3,003
  4. The Changer
    الردود:
    1
    المشاهدات:
    679
  5. Medo533
    الردود:
    2
    المشاهدات:
    855
  6. abullah
    الردود:
    7
    المشاهدات:
    1,184
  7. Ali2010
    الردود:
    7
    المشاهدات:
    1,238
  8. GMC123
    الردود:
    12
    المشاهدات:
    1,281
  9. abullah
    الردود:
    2
    المشاهدات:
    515
  10. متسلق الجبل
    الردود:
    4
    المشاهدات:
    1,163

مشاركة هذه الصفحة