[20232] CSC126: Quick Exercise 2-2

Quiz
•
Computers
•
University
•
Easy
ZALIKHA ZULKIFLI
Used 39+ times
FREE Resource
7 questions
Show all answers
1.
OPEN ENDED QUESTION
5 mins • 2 pts
Write a C++ declaration statement for each of the following questions:
Declare three variables as integer. Assign the first variable to 10.
Evaluate responses using AI:
OFF
Answer explanation
int num1 = 10, num2, num3;
OR
int num1 = 10;
int num2;
int num3;
2.
OPEN ENDED QUESTION
5 mins • 1 pt
Write a C++ declaration statement for each of the following questions:
Declare a constant variable named RATE as float and assign it to 0.125.
Evaluate responses using AI:
OFF
Answer explanation
const float RATE = 0.125;
3.
OPEN ENDED QUESTION
5 mins • 1 pt
Write a C++ declaration statement for each of the following questions:
Declare a floating-point variable named initial with value 100.
Evaluate responses using AI:
OFF
Answer explanation
float initial = 100;
4.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Given the following declaration:
int w = 5, x = 7, y = 3, z = 12;
What is the result of the following expression?
w * x % y + z
14
17
21
22
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What is the result of the following expression if data type of y is int?
y = 4 + (3 * (8 + 6) – 3) / 2
17.5
23.5
23
29
6.
OPEN ENDED QUESTION
5 mins • 1 pt
Evaluate the following expression:
x = 42 % 5 + 7 – (2 + 8) / 3;
Evaluate responses using AI:
OFF
Answer explanation
6
7.
OPEN ENDED QUESTION
5 mins • 1 pt
Evaluate the following expression:
y = 13.0 + 9 / 2.0
Evaluate responses using AI:
OFF
Answer explanation
17.5
Similar Resources on Wayground
10 questions
GDSC Android Bootcamp [Kotlin Quiz]

Quiz
•
University
10 questions
Quiz 8: Arrays&Vector

Quiz
•
University
10 questions
Session 2 Quiz

Quiz
•
University
8 questions
Mastering Python Basics

Quiz
•
University
10 questions
OOPJ- Data Types-Java

Quiz
•
University
10 questions
Introduction to Java

Quiz
•
University
10 questions
Python Basics Quiz

Quiz
•
7th Grade - University
6 questions
PPS MCQ on 22.11.2024

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University