Naming rules for creating variables

Assignment Help Basic Computer Science
Reference no: EM13925142

1. Which of the following is false?

  • All elements of the array have the same data type.
  • All elements in an array have the same name.
  • All elements in an array have the same subscript.
  • The first element of the array has a subscript of zero.

2. Typically, the first item in defining a function is _____.

  • an open curly brace "{"
  • passing an argument
  • passing the function
  • naming the function

3. What is a variable's scope?

  • The length of time the variable is in existence
  • Determines who can see and access the variable
  • It is the length of time the variable is in existence, AND determines who can see and access the variable.
  • None of these

4. Float and double variables should not be used _____.

  • as counters
  • to perform mathematical calculations
  • as approximate representations of decimal numbers
  • for applications when precision is required

5. Consider the following segment of code.

if(apple != Orange)
cout<<"You got Oranges!"<else
cout<<"You got Apples";
cout<<"The end of the program is reached.";

What error can you identify?

  • A double quotation mark was incorrectly inserted.
  • You cannot compare apples to oranges.
  • Assumes indentation has a logical purpose
  • No error

6. Explain the naming rules for creating variables, and then provide three examples using the data types int, double, and char and assign values to them.

7. What is the advantage of using the conditional operator?

8. Create a C++ program that declares, initializes, and outputs the values contained in a two-dimensional array

9. Create a code segment that defines a class definition for a student. Include at least two properties and two methods. Also explain the reason why there is a public and private section associated with class definitions.

Reference no: EM13925142

Questions Cloud

What do you mean by credit risk analysis : What do you mean by credit risk analysis? Is it an art or science? Do you believe traders and manufacturers also require credit risk analysis before they extend credit to their customers? Please elaborate.
What is best way to prepare for course in computer science : What is the best way to prepare for a course in computer science, which is specifically fundamentals in web development? I will begin to take this course in the spring of 2016.
Explain the major causes of credit risk : Explain the major causes (sources) of credit risk. Is it true that non-financial institutions also have significant credit risk exposure? Please elaborate.
Corporate shareholders are exposed to unlimited liability. : Although its stockholders are insulated by limited legal liability, the legal status of the corporation does not protect the firm's managers in the same way, i.e., bondholders can sue its managers if the firm defaults on its debt, even if the defa..
Naming rules for creating variables : 6. Explain the naming rules for creating variables, and then provide three examples using the data types int, double, and char and assign values to them. 7. What is the advantage of using the conditional operator?
What constitutes a threat to a network : What is cyber warfare, What is a network and What constitutes a threat to a network?
What are the challenges of credit risk analysis : What are the challenges of credit risk analysis? What do you mean by portfolio credit risk? How does it differ from firm (or obligor) credit risk?
What do you mean by credit risk culture : What do you mean by credit risk culture? Discuss its importance. Explain the importance of credit risk appetite. What are the factors to be considered while deciding credit risk appetite?
Provide your reasoning using ethical codes of conduct : Beside each situation below, place a check by the term(s) that best reflects your opinion of the behavior of the individual. Provide your reasoning for each of your answers using both the ethical codes of conduct and the information on computer cr..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Some time on a new parallel computer

You are given some time on a new parallel computer. You run a program which parallelizes perfectly during certain phases, but which must run serially during others.

  Writing a new class that is derived from another class

Writing a new class that is derived from another class.You will be given the code for a Car class. Your job is to write a CustomCar class that is derived from Car and adds new features to it.

  Create a class that simulates an alarm clock

create a class that simulates an alarm clock. In this class you should *store time in hours, minutes, and seconds. Note if time is am or pm. (hint: you should have separate private members for the alarm and the clock.

  How does aging hardware affect this advantage

What competitive advantage does technology give to business? How does aging hardware affect this advantage

  Describe retail events in terms of pci compliance standard

You visit retail establishment, shop around, and ultimately carry several products to one of the point of sale. Document each main events just explained and describe them in terms of PCI compliance standard.

  Draw the uml class diagram for the schoolbus

The declaration for the SchoolBus class. Instances of the SchoolBus class represent school buses of varying sizes. The class provides functions to add and remove students.

  Create an array to hold the hours and the hourly rate

Create an array to hold the hours and the hourly rate. Then print out the wages for each entry. The program should use a multi-dimensional array, a loop, and a jsr to calculate and print the values. this is in Jasmin language

  Three years for applications of information security

Five articles within the past three years for applications of information security, within healthcare organizations.

  Describe the challenges faced by us customs

Based on the assigned readings, your responses are to be in your own words with no copying except for minimal quotes that must be properly cited. What I am looking for here are your own thoughts and opinions that demonstrate your understanding of the..

  Why can i only see up to the index of this book

Why can I only see up to the index of this book? I understand it's a large book and you may only want to give the reader access to part of the book, but if it's read only until I get my book in the mail, why can't I see the whole book

  Give time line which identify specific steps of installation

Give a time line, which identifies specific steps (including training) and related resources required to implement the recommended system.

  What do you mean by data independence

What do you mean by data independence? Explain your answer, paying attention to how data independence is implemented.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd