• 0
  • مالي خلق
  • أتهاوش
  • متضايق
  • مريض
  • مستانس
  • مستغرب
  • مشتط
  • أسولف
  • مغرم
  • معصب
  • منحرج
  • آكل
  • ابكي
  • ارقص
  • اصلي
  • استهبل
  • اضحك
  • اضحك  2
  • تعجبني
  • بضبطلك
  • رايق
  • زعلان
  • عبقري
  • نايم
  • طبيعي
  • كشخة
  • النتائج 1 إلى 5 من 5

    الموضوع: Can u guys help me on this

    1. #1
      التسجيل
      21-02-2002
      الدولة
      Blue
      المشاركات
      728
      المواضيع
      81
      شكر / اعجاب مشاركة

      Can u guys help me on this

      Question 1:

      Write a program that reads in two integers from the user. The program should then calculate the sum of all even integers and the product of all odd integers between them exclusive (the two boundary numbers must not be included).

      Sample Input/Output:

      Enter two integers, please:
      10 20

      The even integers between 10 and 20 are:
      12 14 16 18, and their sum is: 60

      The odd integers between 10 and 20 are:
      11 13 15 17 19, and their product is: 692835



      Question2:

      After many years of being frustrated by a checkbook that just will not balance, you decide to write a program to help balance your money market checking account. The program should begin by asking the user for the month's opening account balance. Then the program should display a menu that lists the following choices: D for a deposit, C for a check, W for a withdrawal, and Q for quit. If the user selects D, ask the user to enter the amount of the deposit, and add the amount to the account balance. If the user enters C, ask the user for the amount of the check, and subtract the check amount form the balance. If the user enters W, ask the user for the amount of the withdrawal, and subtract the amount from the balance. When the user enters Q, the program should display the opening balance, the total amount deposited, the total amount withdrawn, the total amount of the checks, and the final balance. If the user enters something other than D, W, C, or Q, the program should issue an error message and redisplay the menu. Allow the user to enter either upper - or lowercase letters.

      Sample Input/Output:

      Enter your opening account:
      5000
      -------------------------------------------------------------
      Here are the list of services provided by our program:
      Enter D for deposit.
      Enter C for check.
      Enter W for withdrawal.
      Enter Q for quitting the program (in which case all your information will be displayed).
      -------------------------------------------------------------
      Enter your choice (Q to quit the program):
      D
      You would like to deposit an amount of money.
      Enter the amount:
      2000
      Enter your choice (Q to quit the program):
      C
      This is a service provided for checks.
      Enter the amount of the check:
      1000
      Enter your choice (Q to quit the program):
      W
      You would like to withdraw an amount of money.
      Enter the amount:
      1500
      Enter your choice (Q to quit the program):
      D
      You would like to deposit an amount of money.
      Enter the amount:
      3500

      Enter your choice (Q to quit the program):
      Q
      You are to quit the program. Here is your final information.
      ------------------------------------------------------------------------
      Opening Balance: 5000.
      Total amount of deposits: 5500
      Total amount of checks: 1000
      Total amount of withdrawals: 1500
      Final Balance: 8000



      Bonus Question:

      The perfect square of a number is defined as the sum of consecutive odd, positive integers starting at 1 (and ending at some odd index N). In other words, given any number, you should find the square of this number and find all odd numbers whose sum will make the square of the given number. Your task is to write a program that checks that this definition holds for a various values of numbers. Your program should work for more than one number. If the user enters -1, your program should come to end.

      Sample Input/Output:
      Enter a number, please (-1 to end the program):
      4
      The square of 4 (16) is a perfect square, because
      1 + 3 + 5 + 7 = 4 * 4 = 16
      Enter a number, please (-1 to end the program):
      5
      The square of 5 (25) is a perfect square, because:
      1 + 3 + 5 + 7 + 9 = 5 * 5 = 25
      Enter a number, please (-1 to end the program):
      7
      The square of 7 (49) is a perfect square, because:
      1 + 3 + 5 + 7 + 9 + 11 + 13 = 7 * 7 = 49

      Can u guys help me on these plz



      So maybe tomorrow
      I'll find my way home
      So maybe tomorrow
      I'll find my way home

      I look around at a beautiful life
      Been the upperside of down
      Been the inside of out
      But we breathe
      We breathe

      I wanna breeze and an open mind
      I wanna swim in the ocean
      Wanna take my time for me
      All me


    2. #2
      التسجيل
      09-12-2000
      الدولة
      امريكا / كانساس /لورانس
      المشاركات
      2,961
      المواضيع
      93
      شكر / اعجاب مشاركة

      Re: Can u guys help me on this

      what is the programming language?
      سبحان الله و بحمده... سبحان الله العظيم



    3. #3
      التسجيل
      21-02-2002
      الدولة
      Blue
      المشاركات
      728
      المواضيع
      81
      شكر / اعجاب مشاركة

      Re: Can u guys help me on this

      ohh sorry i forgot it's C/C++ , i think we must use do - while here .



      So maybe tomorrow
      I'll find my way home
      So maybe tomorrow
      I'll find my way home

      I look around at a beautiful life
      Been the upperside of down
      Been the inside of out
      But we breathe
      We breathe

      I wanna breeze and an open mind
      I wanna swim in the ocean
      Wanna take my time for me
      All me


    4. #4
      التسجيل
      05-08-2002
      الدولة
      here....there......do u care!!!
      المشاركات
      6,530
      المواضيع
      57
      شكر / اعجاب مشاركة

      Re: Can u guys help me on this

      هممم اظن ردي متاخر


      بس عموما عرفت لفكرة سؤال الباونس

      وحليته في ربع ساعة مشالله علي مشالله قولوا مشالله ههههه


      امم هذا الحل بس هنا متلخبط مع التنسيق




      #include <iostream.h>
      #include <conio.h>

      void main()
      {
      int num=0;
      do
      {
      int i=1,counter=0;
      cout << "\nEnter a number, please (-1 to end the program):\n";
      cin >> num;
      if(num!=-1)
      {
      cout << "The square of "<<num<<"("<<num*num<<") is a perfect square, because:\n";

      do
      {
      cout << i << "+" ;
      i+=2;
      counter++;
      }while(counter<num);
      cout << "\b="<<num<<"*"<<num<<"="<<num*num ;
      }
      }while(num!=-1);
      getch();

      }



      سو له كوبي بيست^__________________^



      اما الباقي والله واري اختبار مقدر الحين احلهم


      اتمنى مايكون وقت الباونس خلص


      سلام^________^
      "اللهم صلي على نبيك محمد عدد ماذكره الذاكرون وغفل عنه الغافلون"

    5. #5
      التسجيل
      21-02-2002
      الدولة
      Blue
      المشاركات
      728
      المواضيع
      81
      شكر / اعجاب مشاركة

      Talking Re: Can u guys help me on this

      اقتباس المشاركة الأصلية كتبت بواسطة Lena
      هممم اظن ردي متاخر


      بس عموما عرفت لفكرة سؤال الباونس

      وحليته في ربع ساعة مشالله علي مشالله قولوا مشالله ههههه


      امم هذا الحل بس هنا متلخبط مع التنسيق




      #include <iostream.h>
      #include <conio.h>

      void main()
      {
      int num=0;
      do
      {
      int i=1,counter=0;
      cout << "\nEnter a number, please (-1 to end the program):\n";
      cin >> num;
      if(num!=-1)
      {
      cout << "The square of "<<num<<"("<<num*num<<") is a perfect square, because:\n";

      do
      {
      cout << i << "+" ;
      i+=2;
      counter++;
      }while(counter<num);
      cout << "\b="<<num<<"*"<<num<<"="<<num*num ;
      }
      }while(num!=-1);
      getch();

      }



      سو له كوبي بيست^__________________^



      اما الباقي والله واري اختبار مقدر الحين احلهم


      اتمنى مايكون وقت الباونس خلص


      سلام^________^
      Thx alot ^^ it really helped i got "-2" for being late :P

      anyway for the 1st Q
      the solution is :

      # include <stdio.h>

      main()
      {
      int int1, int2, count, sum=0, pro=1 ;


      printf("Enter two Integers, please: ");
      scanf("%d%d", &int1, &int2);
      printf("The EVEN integers between %d and %d are:\n", int1, int2);

      for (count=(int1+1) ; count<int2 ; count++)
      {
      if (count%2==0)
      {
      printf("%d ", count);
      sum=sum+count;
      }

      }
      printf(", and their sum is: %d\n\n", sum);
      printf("\nThe ODD integers between %d and %d are\n", int1, int2);

      for (count=(int1+1) ; count<int2 ; count++)
      {
      if (count%2==1)
      {

      printf("%d ", count);
      pro=pro*count;
      }
      }
      printf(", and their product is: %d", pro);
      printf("\n\n\t\tTHANKYOU\n");
      return 0;
      }

      i just wona know y count=(int1+1)



      So maybe tomorrow
      I'll find my way home
      So maybe tomorrow
      I'll find my way home

      I look around at a beautiful life
      Been the upperside of down
      Been the inside of out
      But we breathe
      We breathe

      I wanna breeze and an open mind
      I wanna swim in the ocean
      Wanna take my time for me
      All me


    المواضيع المتشابهه

    1. مشاركات: 726
      آخر مشاركة: 19-05-2007, 09:46 AM
    2. please help me guys
      بواسطة : PS2 N64 DC , في ألعاب الننتندو الحصرية Nintendo Wii U
      مشاركات: 2
      آخر مشاركة: 23-11-2001, 12:43 PM
    3. Hi guys I was Away Tests :P And Its About FFX
      بواسطة : Cybuster , في منتدى فاينال فانتاسي
      مشاركات: 1
      آخر مشاركة: 26-07-2001, 09:27 PM

    ضوابط المشاركة

    • لا تستطيع إضافة مواضيع جديدة
    • لا تستطيع الرد على المواضيع
    • لا تستطيع إرفاق ملفات
    • لا تستطيع تعديل مشاركاتك
    •