المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : حل واجب mt262a مدرس MT262 2013 tma الجامعة العربية المفتوحة Aou



أسواق
10-11-2012, 04:00 PM
MT262A, 2012-2013 offer
Question 1 (30 Marks)
This question is mainly d on Block I – Units 1, 2, and 3 and it tests your ability to design and code the solution of a practical problem using what you learnt so far.
Write a program to input a three integer numbers ten times (I mean ten entries and for each entry you input three numbers). Each of the three numbers is between -100 and 100 and you have to check for this validation. The program when executed will print number of negative numbers in all of the even entries and the absolute value of it. Print a message to tell the use that he/she did not input any negative numbers.
Question 2 (20 Marks)
This question is mainly d on Block I – Units 1, 2, and 3 and it tests your ability to implement a loop.
You are asked to write a C++ program that reads a positive integer, greater than zero, from the user and then outputs a triangle of numbers as appear in the example below. The size of the triangle depends on the integer entered by the user.
Example, if the user enters the number 5 as input, the following triangle appears on the screen:
1
2 2
1 2 3
4 4 4 4
1 2 3 4 5
3
Question 3 (30 Marks)
This question is mainly d on Block II – Unit 1 and it tests your ability to work with arrays.
Consider a 4-by-4 array of characters. Write a C++ program to accomplish each of the following operations:
a. Declare the above array. [2 marks]
b. Read the array. [4 marks]
c. Find and print the number of zeros in both the diagonals of the array. [14 marks]
d. Replace each even number in the array by zero and then print the array as rows and columns. [10 marks]
GOOD LUCK