a.
Explanation of Solution
Justification:
Given variable name is “discountPercentage”
The expected data type for “discountPercentage” variable is “double”.
The string formatting parameters are “p” or “P” for percentage format.
Example program:
//Include libraries
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows...
b.
Explanation of Solution
Justification:
Given variable name is “atomicWeight”
The expected data type for “atomicWeight” variable is “double”.
The string formatting parameters are “f” or “F” for percentage format.
Example program:
//Include libraries
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System...
c.
Explanation of Solution
Justification:
Given variable name is “retailPrice”
The expected data type for “retailPrice” variable is “decimal”.
The string formatting parameters are “c” or “C” for percentage format.
Example program:
//Include libraries
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System...
d.
Explanation of Solution
Justification:
Given variable name is “quantityPurchased”
The expected data type for “quantityPurchased” variable is “int”.
The string formatting parameters are “n” or “N” for percentage format.
Example program:
//Include libraries
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System...
e.
Explanation of Solution
Justification:
Given variable name is “degreesKelvin”
The expected data type for “degreesKelvin” variable is “int”.
The string formatting parameters are “e” or “E” for percentage format.
Example program:
//Include libraries
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System...
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Starting out with Visual C# (4th Edition)
- What is the benefit of being able to define an initial value when you can assign a value to a variable?arrow_forwardWhat is the opposite of greater than?arrow_forwardUsing Visual Basic 2019 programming language: VB.NET Franks Software Sales AssignmentYou have been hired by Franks Software Sales to write a program to figure the total cost to customers that order Slappy’s software packages. Discounts are given based on the number of units sold:Number of Units Sold Discount Amount 1–9 None10 – 19 20% 20 – 49 30% 50 – 99 40%100 or more 50% Create a form similar to this:The three boxes are labels. Remember to use the Auto Size and Border Style properties. The program should read the number of units sold and figure a base cost. The units cost $99 each. A discount should then be figured and subtracted from the base cost. The subtotal, discount amount and total cost should be displayed, as currency, in the appropriate labels.Here are some screen shots of the running program:Set the tab order and access keys.Put comments in your program as to what each section is doing. Use constants for the discount rates and base price.Copy your code and paste it into a…arrow_forward
- True or False An error will occur if the compiler finds a statement that tries to change the value of a constant field.arrow_forwardSlappy’s Software Sales AssignmentYou have been hired by Slappy’s Software Sales to write a program to figure thetotal cost to customers that order Slappy’s software packages.Discounts are given based on the number of units sold:Number of Units Sold Discount Amount1 – 9 None10 – 19 20%20 – 49 30%50 – 99 40%100 or more 50%Create a form similar to this:The three boxes are labels. Remember to use the Auto Size and Border Styleproperties.The program should read the number of units sold and figure a base cost. Theunits cost $99 each. A discount should then be figured and subtracted from thebase cost. The subtotal, discount amount and total cost should be displayed, ascurrency, in the appropriate labels.Here are some screen shots of the running program:Set the tab order and access keys.Put comments in your program as to what each section is doing.Use constants for the discount rates and base price.arrow_forwardWhat kinds of values may be specified as default arguments?arrow_forward
- Financial Assistance Application Create the Financial Assistance Application. A non-governmental organization needs your application to calculate the amount of financial assistance for needy families. The formula is as follows: • If the annual household income is between $30,000 and $40,000 and the house- hold has at least three children, the amount is $1,000 per child. • If the annual household income is between $20,000 and $30,000 and the house- hold has at least two children, the amount is $1,500 per child. • If the annual household income is less than $20,000, the amount is $2,000 per child. Implement a function for this computation. The program asks for the household income and number of children for each applicant, printing the amount returned by your function. Use -1 as a sentinel value for the input. The program output should be formatted as shown in the Sample Run. Note: You must use at least one function in your code.arrow_forwardExplain the difference between passing a variable by value and passing it by reference.arrow_forwardVariable scope is the area in your code where a variable can be accessed? True or Falsearrow_forward
- You have been hired by PetPals Veterinary Clinic to modify its Bill Calculator application. Upon reviewing the application, you notice that all of the controls have their default names. You also notice that the Calculate button’s code uses the properties of controls in the calculation statements. The total amount a customer owes for all of the services performed during an office visit may contain a decimal place. What data type is best for a variable that will store this value? a. String b. Double c. Integer d. Fractionarrow_forwardField Data Type and Size Part number 5 numeric positions Part name 15 alphanumeric positions Quantity in stock 5 numeric positions Another data file named TRANSFL contains the records of transac- tions on the items in the inventory. Each record of this file consists of the following: Field Data Type and Size Part number 5 numeric positions Transaction code 1 numeric position 1 = receipt 2 = issue Quantity transacted 5 numeric positions. Draw a flowchart to show how the master file is updated on the basis of the records of the transaction file. Develop an algorithm for the solu- tion of the above problem. (iv) A data file contains invoice records. The layout of the records is given below: Field Data Type and Size Party Code 5 alphanumeric Invoice Number 6 Numeric Invoice Data 6 ( DD MΜM YY) Gross =Value $7 & cents Discount Amount $6 & cents Sales Tax Amount $7 & cents Net Payable $7 & centsarrow_forward8. Astronomy HelperCreate an application that displays the following data about the planets of the solar system (including Pluto, which is no longer considered a planet). (For your information, the distances are shown in AUs, or astronomical units. 1 AU equals approximately 93 million miles. In your application simply display the distances as they are shown here, in AUs.)MercuryType TerrestrialAverage distance from the sun 0.387 AUMass 3.31 * 1023 kgSurface temperature -173°C to 430°CVenusType TerrestrialAverage distance from the sun 0.7233 AUMass 4.87 * 1024 kgSurface temperature 472°CEarthType TerrestrialAverage distance from the sun 1 AUMass 5.967 * 1024 kgSurface temperature -50°C to 50°CMarsType TerrestrialAverage distance from the sun 1.5237 AUMass 0.6424 * 1024 kgSurface temperature -140°C to 20°CJupiterType JovianAverage distance from the sun 5.2028 AUMass 1.899 * 1027 kgTemperature at cloud tops -110°CSaturnType JovianAverage distance from the sun 9.5388 AUMass 5.69 * 1026…arrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,