الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

طلب مساعده....... ارجوكم....

بدأه a0a0 في 9 يناير 2009 · 5 رد · 1,426 مشاهدة · في C++.Net
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمه الله وبركاته

اتمنى منكم مساعدتي في حل البرامج التاليه

البرنامج الاول.....

Problem 1:

Write a C++ program that reads array values from the user until he presses CTRL+D key and then determines the length of the array and the minimum value.

Note:

- Define the max size of the array to be 30;

- Define a function called Min that returns the minimum value of array elements.

البرنامج الثاني...

Problem 2:

Write and examine the function int frequency( int a [ ], int n, int x ); this function calculate the number of occurrence of entered element x in the n elements of array a; and return it as a number of occurrence of x element in n.

Note:

- Examine your program with array with this initializer list:

double a[ ] = { 651, 508, 400, 301, 329, 599, 455, 400, 346, 346, 329, 375, 561, 390, 399, 400, 401, 561, 405, 405, 455, 508, 473, 329, 561, 505, 329, 455, 561, 599, 561, 455, 346, 301, 455, 561, 399, 599, 508, 508};

- Define a Print function that prints array elements before entering element value.

البرنامج الثالث...

Problem 3:

Define class called Operations which has the following:

1. Private data member Num

2. Set and Get member functions which allow assigning and returning data member in the class. [Hint: in set function you should use Validate(int) member function]

3. A Constructor function that initializes the data member by using set function.

4. Define a member function Factorial() that returns the factorial of data member

Factorial n!=n(n-1)(n-2)..(2)(1)

5. Define member function Fraction() that print integer number from 1 to n with its fraction [Hint: use nested For loop]

e.g. if Num=3

1

1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,

2

2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,

3

3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9,

6. Define member function Validate(int) that validate the integer if it is positive and grater than 1 or not, if not prompt the user to reenter it again and then return the correct positive number.

[Hint: Validate(int) should used by set member function before setting data member to any value – use While loop]

7. Test your function in the main function.

8. The program should contains Two files

  • <LI class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt">Header file:- which contain declaration of private (data members) and public (member functions) with its definitions.
  • Source File: - which contain the main function

وشكرا...اتمنى منكم المساعد وبسرررعه

#2

يعني محد عرف

طيب على الاقل واحد يرد

تكفون ساعدوني ضرررروري

#3

والله خاطري اساعدكـ.........

لي رجعه بإذن الله ^_^ .. اذا ما حصلتني راسلني :) وهذا لإنشغالي

Baneer.jpg
#4
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. int x[50], i = 1, min = 0;
  7.  
  8. cin>>x[0];
  9. min = x[0];
  10.  
  11. while(1)
  12. {
  13. cin>>x[i];
  14. if(x[i] < min) min = x[i];
  15. i++;
  16. }
  17.  
  18. cout<<"The array size is: "<<i<<"The min value is: "<<min;
  19.  
  20. cout<<"nn";
  21. system("PAUSE");
  22. return EXIT_SUCCESS;
  23. }
  24.  

^

^

مشكلة 1 ..

Baneer.jpg
#5

المشكله ال2

  1. #include <iostream>
  2. using namespace std;
  3. int chk ( int a [ ], int n, int x );
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. int a[ ] = { 651, 508, 400, 301, 329, 599, 455, 400, 346, 346, 329, 375, 561, 390, 399, 400
    , 401, 561, 405, 405, 455, 508, 473, 329, 561, 505, 329, 455, 561, 599, 561, 455, 346, 301, 455
    , 561, 399, 599, 508, 508};
  8. int n = sizeof(a)/sizeof(int);
  9. int x;
  10. cout<<"Please input your target: "; cin>>x;
  11.  
  12.  
  13. cout<<n<<"The target "<<x<<" has occured: "<<chk(a,n,x)<<" time(s)";
  14.  
  15. cout<<"nn";
  16. system("PAUSE");
  17. return EXIT_SUCCESS;
  18. }
  19.  
  20. int chk ( int a [ ], int n, int x )
  21. {
  22. int count = 0;
  23. for(int i =0 ; i< n ; i ++)
  24. {
  25. if(a[i] == x)count++;
  26. }
  27. return count;
  28. }
  29.  

البرنامج ال3 خارج استطاعتي ... أتمنى اني ساعدتك :) ... لا تنساني بدعواتك ^_^

Baneer.jpg
#6

مشكورر وما قصرت

الله يجعله في موازين حسناتك

مواضيع مشابهة