0% found this document useful (0 votes)
9 views2 pages

R1 Control Structures in C

The document provides instructions for a research assignment on control structures in C++ programming. Students are asked to research and answer 5 questions about control structures, including the primary types (if/if-else/if-else-if/switch), differences between if and switch statements, loops (while/for/do-while), and the purpose and usage of break, continue, and ternary operators. Students are instructed to cite sources and provide examples in their answers.

Uploaded by

cjerondo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

R1 Control Structures in C

The document provides instructions for a research assignment on control structures in C++ programming. Students are asked to research and answer 5 questions about control structures, including the primary types (if/if-else/if-else-if/switch), differences between if and switch statements, loops (while/for/do-while), and the purpose and usage of break, continue, and ternary operators. Students are instructed to cite sources and provide examples in their answers.

Uploaded by

cjerondo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Student Name : Date :

Student Number : Extra Points :


Section/Block : Rating :

RESEARCH #1: CONTROL STRUCTURES IN C++


If | if-else | if-else-if | switch case

INSTRUCTION: Conduct research on the topic of Control Structures in c++ programming by exploring the
following questions (need a hard copy for submission on September 11, 2023):

1. What are the three primary types of control structures in C++? Provide a brief explanation of each
type.
2. How does the "if" statement differ from the "switch" statement in C++ when it comes to making
decisions in your code? Provide examples for both.
3. Explain the concept of a loop in C++. What are the differences between "while," "for," and "do-
while" loops? When would you use each type of loop?
4. In C++, what is the purpose of the "break" and "continue" statements within loops? Provide
examples to illustrate their usage.
5. Describe the role of conditional operators (e.g., "? :" ternary operator) in control structures in C++.
How do they work, and what are some common use cases for them? Provide examples to
demonstrate their functionality.

NOTE: If you want to answer the questions using google or any tool, then copy and paste the original statement and
write the rephrased answer made by you. See format below; (this will be check according to the content of your research
paper)

Answer from Google (Sample Only)


Question: What is a computer hardware?
Answer: Computer hardware is a collective term used to describe any of the physical components of an analog
or digital computer. The term hardware distinguishes the tangible aspects of a computing device from software,
which consists of written, machine-readable instructions or programs that tell physical components what to do
and when to execute the instructions. Hardware and software are complementary. A computing device can
function efficiently and produce useful output only when both hardware and software work together
appropriately. Computer hardware can be categorized as being either internal or external components.
Generally, internal hardware components are those necessary for the proper functioning of the computer, while
external hardware components are attached to the computer to add or enhance functionality.

Link: https://www.techtarget.com/searchnetworking/definition/hardware

Revised Answer:
Computer hardware refers to all the physical parts of a computer, whether it's a regular or digital one. It's what
you can touch and see, like the screen, keyboard, or the computer's brain, the CPU. Hardware is different from
software, which is the computer's instructions that tell these physical parts what to do. Hardware and software
need to work together for a computer to be useful. It's like having a car (the hardware) and knowing how to
drive it (the software) to go where you want. Computer hardware can be divided into two main groups: stuff
inside the computer (like the CPU, memory, and storage) that make it work, and things you can plug into it from
the outside (like a printer or a mouse) to add more features or abilities.

PROGRAMMING 1 | PROG1
Copy and paste the table below to follow the format to answer the questions.

Answer from Google


Question#1: What are the three primary types of control structures in C++? Provide a brief
explanation of each type.
Answer:

Revised Answer:

Answer from Google


Question#2: How does the "if" statement differ from the "switch" statement in C++ when it comes to
making decisions in your code? Provide examples for both.
Answer:

Revised Answer:

Answer from Google


Question#3: Explain the concept of a loop in C++. What are the differences between "while," "for,"
and "do-while" loops? When would you use each type of loop?
Answer:

Revised Answer:

Answer from Google


Question#4: In C++, what is the purpose of the "break" and "continue" statements within loops?
Provide examples to illustrate their usage.
Answer:

Revised Answer:

Answer from Google


Question#5: Describe the role of conditional operators (e.g., "? :" ternary operator) in control
structures in C++. How do they work, and what are some common use cases for them? Provide
examples to demonstrate their functionality.
Answer:

Revised Answer:

PROGRAMMING 1 | PROG1

You might also like