تم الحل ✓
categoryبرمجة وتطوير البرمجيات
schoolبكالوريوس
event_available2026-07-14
السؤال
Transcribed Image Text:
Problem 1 (6 Points)
The following program contains several errors. Determine what the errors are, and submit the corrected
.cpp file. To receive points, it should run perfectly when the grader runs it.
*/ Now you should not forget your glasses //
#include <stream>
int main
{
cout << "If this text",
cout>>" appears on your display, ";
cout << endl;"
"
cout << 'you can pat yourself on '
<< "the back!" << endl.
return 0;
)
Problem 2 (9 Points)
Initialize variables of the following types and assign them a value:
⚫ integer
⚫ Character
⚫ double
The values could be anything; however, make sure you agree with the variable type the workspace is
telling you. Remember that every value (integer, character, and array) needs to have an acceptable
variable name. Rules for variables: do not have spaces in them, do not start with a number, and do not
have names similar to predefined functions or names standard to C++.
Then perform the following:
Create two more float-point type variables to store the values 123.456 and 76.543.
Calculate the sum and difference of the two numbers on screen
Should look like the following output:
x + y = 377.579
x-y -130.667
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.