تم الحل ✓
categoryبرمجة وتطوير البرمجيات
schoolبكالوريوس
event_available2026-07-13
السؤال
Transcribed Image Text:
Part Two: Answer the following question using C++ code.
Question 01 (38 points)
Write a function that takes as a parameter an integer (as a long long value) and returns the number o
odd, even, and zero digits. Also write a program to test your function.
Question 02 (30 points)
Write code that will fill the array (declared below) with numbers typed in at the keyboard; after y
read the numbers, print the average of each row and the average
\of each column;
int a[4][5];
{
Question 03 (40 points)
Consider the following code:
class one
public:
void print() const;
//Output the values of x and y
protected:
private:
void setData(int u, int v):
//Postcondition: x = u; y = v;
}
int x;
inty:
class two: public one
{
public:
private:
void setData(int a, int b, int c);
//Postcondition: x = a; y = b; z = c;
void print() const;
//Output the values of x, y, and z
two();
//sets the values of instance variables to 0,
two(int, int, int);
//sets the values of instance variables according
//to the parameters.
}:
int z;
Write the definition of the functions of the class two.
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.