Starting from:

$25

CECS282 - Lab1 - Solved

Assignment
1.    For each of the following statements, indicate if the statement would compile (does not contain anycompile-time errors) in the Java language and/or the C++ language. Assume that the statements are executed in order, so using the variable x always refers to the int x declared in the rst statement 

Statement
Compile in C++?√
Compile in Java?√
int x = 5;
 
 
x = 1.5;
 
 
if (x + 1)
 
 
char c = (char)(’A’ + x);
 
 
2.    Which of the following are NOT explicitly stated design goals of the C++ language? Mark all that apply.

(a)       Compatibility with programs written in the C language

(b)       If you don’t want feature x, you shouldn’t have to pay for it in performance

(c)       Consistent and de ned sizes for fundamental variable types

(d)       Using the language for embedded Web browser applications

(e)       Uncompromising speed and e ciency

3.    Register for Campuswire. Log in, then vote on the Welcome Poll.

4.    Show me that you know how to access the course code les from GitHub. Either:

(a)       Complete Homework 0 on your laptop. Show me your local clone of the code repository. (Mystrong recommendation. You need to learn how to use Git in order to be employable. Students constantly complain that they don’t get exposed to Git in our curriculum. Here is your chance.)

(b)       Locate the Download ZIP link on the course GitHub page. Using this link requires you to download the entire repository every time there is an update, which is not ideal; but this option is open to you if you are using a computer in the lab room, or a device that does not support Git.

5.    Create a Hello world project that prints your name using your chosen IDE. In Visual Studio 2019:

(a)       Create a New Project, either through the button on the launch screen, or through the File -> New menu.

(b)       Select C++ from the Languages list.

(c)       Select Console App from the project templates.

(d)       Choose an appropriate name and location for your project.

(e)       Change the code that is auto-generated to print your name.

(f)        Run the project.

More products