Question: 1) Create a variable of the appropriate data type to hold the following pieces of information and initialize with a literal value. Social security number
1) Create a variable of the appropriate data type to hold the following pieces of information and initialize with a literal value. Social security number with dashes. 2) Create a variable of the appropriate data type to hold the following pieces of information and initialize with the literal value. Whether or not it is raining. 3)Create a variable of the appropriate variable data type to hold the following pieces of information and initialize with literal value. Annual percentage rate (APR)*. 4) Create a variable of the appropriate data type to hold the following pieces of information and initialize with the literal value . Letter Grade. 5)Create a variable of the appropriate data type to hold the following pieces of information and initialize with a literal value. Number of students in a class. 6) Create a class backpack with the following attributes: Color of type string, numCompartments of type int, price of type double. 7)Write a property that contains a get and set for the attribute for the attribute numCompartments. Do not include any conditional expressions in the setter; just do the work of reading from and assigning to the field. 8)Write a paramerterless constructor that initiates the fields as follows: the color to "black", numCompartments to 2, price to 22.50. You may access the fields directly (you don't have to use properties). 9)Write a method named "monogramBag". Your method does not need to return anything or take in any arguments. In the method, ask how many letters will be used for the monogram (don't worry about collecting the letters or using them in any way. You are only concerned with how many letters. Increase the bag by $1.25 per letter. You may access the price field directly ( don't have to use properties). 10)Show how you'd create one instance of the backpack using the paramterless constructor. Don't worry about writing the Namespace, Main Class or Main method header. Invoke the "monogramBag" method on that insstance, and output that instance to the console. Don't worry about the ToString method here. Just show how you'd print the instance from main, assuming it had been overridden.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
