هام جدا لمستخدمي بريد الياهو من الأعضاء



>>>>>>>>>> للتسجيل في الموقع أضغط هنا <<<<<<<<<<


عـودة للخلف   منتديات كتاب العرب > كلية تكنولوجيا المعلومات > البرمجة


الرد على الموضوع
 
خيارات الموضوع طريقة العرض
  #1  
قديم 2008-04-29, 04:54 PM
 
Question إلحقوني بالجواب

هذا السؤال
1. Define class called Vowel which has the following:
2. Private data members: num that represent number of lines, and ch that represents the character to be found.
3. Set and Get member functions which allow assigning and returning each data member in the class. For every data member there are Set and Get functions.
4. A Constructor function that initializes the data members by using set functions.
5. Define a member function numVowel() that read and print number of vowels in all lines. [Hint: use nested loop: outer for loop, inner while loop]
6. Define member function findChar() that read one line and print the location of the first appearance of ch, if not, print "The text you entered doesn't have ch"
7. Define member function Validate(int) that validate the integer if it is positive 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 functions before setting data member to any value – use While loop]


هذا جوابي وبقولكم وش اللي ناقص
كود:
 
#include <iosream>
using namespace std;
class Vowel
{
 private:
 int num;
 char ch;
 
 public:
 
 Vowel(int x,char y)
 {
  setnum(x);
  setchar(y);
 }
 
 void setnum(int x)
 {
  num=validate(x);
 }
 
 void setch(char y)
 {
  ch=y;
 }
 
 int getnum()
 {
  return num;
 }
 
 int getch()
 {
  return ch;
 }
 
 int validate(int x)
 {
  while (x<0)
  {
   cout<<"enter a number";
   cin>>x
  }
  return x;
 }
 
 void numvowel()
 {
  cin.get(2);
  char c;
  c=cin.get(); 
  for (int i=1;i<=num;i++)
  {
  
  while(c=="\n")
  swich(c)
  {
   int sum=0;
   case 'a': sum++;
   case 'o': sum++;
   case 'i': sum++;
   case 'u': sum++;
   case 'e': sum++;
  }
  c=cin.get();
  }
 
 cout<<"the number of vowel is: "<<sum;
       }

الكلاس ماخلص ... اللي ناقصي من السؤال هذا
إقتباس:
Define member function findChar() that read one line and print the location of the first appearance of ch, if not, print "The text you entered doesn't have ch"
7.



انا في الانتظااااار

الرد باقتباس
  #2  
قديم 2008-04-30, 12:13 AM
 
رد : إلحقوني بالجواب

7
7
7
7
7
7
:^) وينكم ...... ياليت ألقى جواب :^)

الرد باقتباس
الرد على الموضوع

مواقع النشر (المفضلة)


يتصفح الموضوع حالياً : 1 (0 عضو و 1 ضيف)
 
خيارات الموضوع
طريقة العرض

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

BB code is متاح
كود [IMG] متاح
كود HTML مغلق
Trackbacks are مغلق
Pingbacks are مغلق
Refbacks are مغلق



الساعة الآن +3: 07:18 AM.


Please seek an excuse for Arabsbook.com it is not responsible for the coming of topics by members and put the responsibility entirely on the subject's owner , and Arabsbook.com is open forum for members to put different subjects in striving for a review of topics, according to general laws for the protection of property . If there are any company or institution has a problem with one of the topics, please contact us.
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.