Question

In: Computer Science

1, Write an appropriate compile-time initialization for a memory location named courseNumber. Store CS 158 as...

1, Write an appropriate compile-time initialization for a memory location named courseNumber. Store CS 158 as the initial value in the memory location. ______________________________

2, To declare a memory location to store the town where you were born, you would write _______________________.  The identifier (memory location name) you should use is homeTown. It follows the rules for naming identifiers. Be sure to end your declaration with a semicolon.

3, The default data type used for floating point values is __________. You could store the amount of money in your checking account in this memory location.

4,To create a memory location to store the count for the number of correct responses use the ____________ data type.

5,Write an appropriate compile-time initialization for a memory location named lastQuestion that could store true or false as a boolean in the memory cell. ________________________

This is from my computer science c# class

Solutions

Expert Solution

1) As the value to be stored is 'CS 158' which is alpha neumeric, it is good to store the value in string as follows

                         string courseNumber ="CS 158";

2) string is used to store the hometown name.

                       string homeTown;

3) Default data type in c# to store real numbers are double

4) int (integer) can be used to store the count in c#

5) bool is the keyword used to create boolean variables in c#

                    bool lastQuestion=true;

The above statement will initialize lastQuestion variable to true . Defualt value of boolean variable in c# is false


Related Solutions

HCS12 Assembly Language: 1. Write a program to convert a decimal number stored at memory location...
HCS12 Assembly Language: 1. Write a program to convert a decimal number stored at memory location $1010 into a binary number. Store the result in memory location $2000
Write a program segment to copy a table with five items from a memory location starting...
Write a program segment to copy a table with five items from a memory location starting at $5000 to a memory location starting at $6000.
Chicken Sandwiches (CS) Qcs Store 1 Quantity of chicken sandwiches sold per day Price CS Price...
Chicken Sandwiches (CS) Qcs Store 1 Quantity of chicken sandwiches sold per day Price CS Price H A = Advertising expenditures in thousands of dollars I = After tax Income per week 1 1000 3.59 3 20 280 2 1100 3.39 2.89 16 280 3 1050 3.39 2.29 12 300 4 2000 2.99 2.69 20 450 5 2200 2.79 3 22 460 6 2100 2.49 3 22 450 7 1900 2.97 3 21 320 8 1100 3.49 2.59 16 280...
Write a class named RetailItem that holds data about an item in retail store.
Python 3Your program will have 2 classes:A) RetailItem ClassWrite a class named RetailItem that holds data about an item in retail store.Attributes: The class should store following data in attributes:>item_Name> PriceMethods:> RetailItem class’s __init__ method should accept an argument for each attribute.> RetailItem class should also have accessor and mutator methods for each attributeB) MainMenu ClassAttributes: The class should store following data in attributes:> List of RetailItem Objects: InventoryMethods:> createInventory(): method to create three RetailItem Objects store in list Inventory...
(14) Write a PIC16F877A assembler subroutine called “Mul_8x8” to multiply register Numb1 in memory location 20h,...
(14) Write a PIC16F877A assembler subroutine called “Mul_8x8” to multiply register Numb1 in memory location 20h, with register Numb2 in memory location 21h. The least significant byte result must be placed in register “AnswL” in memory location 22h. The most significant byte result must be placed in register “AnswH” in memory location 23h. Data in registers Numb1 and Numb2 must remain unchanged after the multiplication. First sketch a flowchart to determine the program structure and then write the firmware source...
Pizza is a new local lunch time pizza parlor with one store location. Pizza making is...
Pizza is a new local lunch time pizza parlor with one store location. Pizza making is a multiple step process. The first two steps, mixing the dough and making the sauce, can be done simultaneously during off peak times. Sauce and balls of dough can be refrigerated and stored. These activities are not included in the problem. During the lunch rush, there are three main steps to pizza making: assembly, baking, and boxing. Once an order is placed, the chef...
Write the code to create an array named movies and store three of your favorite movies...
Write the code to create an array named movies and store three of your favorite movies in the array. Only provide the array and code needed to put the movie names in the array. Do not include additional code
1.) Define Memory 2.) Define each (Capacity and duration/time):    a. sensory memory    b. short-term...
1.) Define Memory 2.) Define each (Capacity and duration/time):    a. sensory memory    b. short-term memory    c. long-term memory 3.) Describe the process of information going through these three memory stages.
C++ Memory Allocation: 1) Write a C++ program that allocates static, stack, & heap memory. Your...
C++ Memory Allocation: 1) Write a C++ program that allocates static, stack, & heap memory. Your program does not need to do anything else.  Indicate via comments where memory for at least one variable in each memory area is allocated. a) Write code that allocates static memory (only include one declaration): b) Write code that allocates stack memory (only include one declaration): c) Write code that allocates heap memory (only include one declaration): 2) Edit the C++ program below to include...
Write a complete program (possible to compile) that: 1) declares two local integers x and y...
Write a complete program (possible to compile) that: 1) declares two local integers x and y 2) defines a global structure containing two pointers (xptr,yptr) and an integer (z) 3) Declares a variable (mst) by the type of previous structure 4) requests the values of x and y from the user using only one scanf statement 5) sets the first pointer in the struct to point to x 6) sets the second pointer in the struct to point to y...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT