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

DO NOT ANSWER THIS[1. Write a program named filemaker.py that will be used to store the...
DO NOT ANSWER THIS[1. Write a program named filemaker.py that will be used to store the first name and age of some friends in a text file named friends.txt. The program must use a while loop that prompts the user to enter the first name and age of each friend. Each of these entries should be written to its own line in the text file (2 lines of data per friend). The while loop should repeat until the user presses...
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 program named filemaker.py in python that will be used to store the first name...
Write a program named filemaker.py in python that will be used to store the first name and age of some friends in a text file named friends.txt. The program must use a while loop that prompts the user to enter the first name and age of each friend. Each of these entries should be written to its own line in the text file (2 lines of data per friend). The while loop should repeat until the user presses Enter (Return...
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
JavaScript Write a function named "reverse_kvs" that has a key-value store as a parameter and returns...
JavaScript Write a function named "reverse_kvs" that has a key-value store as a parameter and returns a new key-value store. Your function should add each key-value pair in the parameter to the new key-value store EXCEPT reversing the key and value. For example, if the key-value "extreme":45 were in the parameter then the returned key-value store should contain the key-value pair 45:"extreme". Code: function reverse_kvs(store) { var reverse_store = {}; for (var key in store) { if (store.hasOwnProperty(key)) { reverse_store[store[key]]...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT