CSC1253 WORKSHEET 1

docx

School

Louisiana State University *

*We aren’t endorsed by this school

Course

1253

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

3

Uploaded by BailiffFinchMaster935

Report
CSC 1253 Supplemental Instruction Worksheet #1 Date: 02/01/2022 SI leader: David Holguin Email: dholgu1@lsu.edu Office Hours: Wed-Sun by appointment. SI sessions: TBA Topics: - Basics of C++ --> HOW TO START A PROJECT ON XCODE (macOS) - Understanding, declaring, and using variables. Questions: 1. Which of the following is an example of low-level language? a. "Mary goes to school everyday" b. 1001011 c. cout<<"Hello World"<<endl; d. "Ana corre muy lento." 2. A programming ______ is a collection of ____ code that programmers can use to add more functionalities to a code and optimize tasks. Many of these are essential for basic text printing and advanced math operations. a. useless b. Java c. prewritten d. machine language e. unlawful f. alien g. library
3. What is “using namespace std” for? 4. How does main work? 5. How do we use brackets? 6. When do we use semi-colons? 7. How do you comment something within a program? Why should we use comments? 8. What is a variable in a computer science sense? 9. List the main 7 data types: 10. How do you declare a variable? 11. Which of the following is initializing a variable? a. int age; b. float boats99; c. init {} boats99; d. start variable: double x; e. int age = 30; 12. What is the difference between declaring a variable and initializing a variable? 13. Mark the following variable names as valid or invalid : - DENOMINATOR - num3rator - Side-Length - double - int_double - camelCase99002 - 2026class - Patrick F. Taylor
14. Which symbol do you use when declaring a char vs, a string? " " [] ' ' ( ) $ $ * * 15. What is the scope of a variable, and how do we find it? Practice Code 1. Create a new project in your compiler. 2. Comment your name and lsu email 3. Include the library required to use cout, and make sure to use the Standard namespace. 4. Create your main function. 5. Declare 5 variables and initialize them: one is for your first name, one for your age (assume you will perform math operations with it), one for your classroom number, one for your last name initial, and one for the constant 3.1416. 6. Reduce clutter by including alike variables in the same line. 7. Display the variables in reverse order than given. Each in a separate line.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help