Professional Documents
Culture Documents
5782SemBMoedA
5782SemBMoedA
5782SemBMoedA
יש להכניס את הקוד במקום המיועד לכך בתוך התכנית הבאה ,כך שבמשתנה oddDigNumיהיה המספר החדש
שיצרת .אין למחוק או לשנות דבר מהקוד הרשום פה .יש להוסיף קוד רק במקום המיועד לכך.
>#include <iostream
;using namespace std
*/
Fill here your details:
Name:
Id:
*/
{ )(int main
;int num
*/
*/
;cout <<"The new number is: " << oddDigNum
;return 0
}
בס"ד
יש להגיש את הקוד כולו ,בתיבת ההגשה הנקראת בוחן אמצע חלק ב' עד השעה 11:50ולכן מאוד מומלץ לנסות
להגיש את בוחן האמצע לפני שעה זו ,מי שלא מצליח להגיש את הבוחן בזמן (עד השעה )11:50עליו לפעול כך:
כל הגשה באיחור תישקל לגופה על פי הטופס שמילאתם .תזכורת :מטרת התיבה של הגשה באיחור היא
לטפל בבעיות של המודל .כל סיבה אחרת לא תתקבל.
This part has one question. You can begin this part only after completing Part A. It is advisable for you
to use Visual Studio but not necessary.
You need to hand in this part no later than 11:50 a.m. It is advisable for you to submit it after 30
minutes (aka 11:40) so that you will have 10 minutes spare to deal with problems in submitting the file
should such a problem occur.
The submission box is similar to the one that you are already familiar with for submitting your
homeworks. (The only difference is that now you will not receive a grade from the automatic grader.)
You are to write a program that will receive a number as input. It is not known how many digits
are in the number. The program is to build a new number that it made up of all of the digits from
the original number that appear in an “odd” place (aka the digit in the ones place and then the
digit in the 100s place etc) and output that number.
For example,
You are to only add code to the place that is specified in the program below in such a way that
the variable oddDigNum will contains the value of the number that you built.
You may not erase nor change any of the code that are already written. You are only to add
code to the designated area.
#include <iostream>
using namespace std;
/*
Fill here your details:
Name:
Id:
*/
int main() {
int num;
/*
*/
cout <<"The new number is: " << oddDigNum;
return 0;
}
בס"ד
You are to submit Part B by 11:50 a.m. (the entire program) in the submission box titled Midterm – Part
B
It is highly recommended that you try and submit before. If you encounter problems uploading your file
at 11:50 you must:
Immediately let us know of the problem. A link to the form for reporting problems will be available
in Moodle.
Afterwards, upload your file again. (This time there will be a separate box for anyone who could not
hand in their program on time. The title of the submission box is “Submission Box – for late
submissions”)
We will take into consideration what you filled out in the form when deciding upon whether or not
to accept your excuse. The purpose of the late submission box is to take care of problems that were
cause by Moodle. Any other reason for submitting late will not be accepted.
The submission box will automatically close at 12:05 and afterwards, you will not have the
opportunity to submit your file.