1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Natali5045456 [20]
3 years ago
12

In this chapter, you learned that although a double and a decimal both hold floating-point numbers, a double can hold a larger v

alue.
Write a C# program named DoubleDecimalTest that declares and displays two variables—a double and a decimal.
Computers and Technology
1 answer:
Sholpan [36]3 years ago
5 0

Answer:

The DoubleDecimalTest class is as follows:

using System;

class DoubleDecimalTest {

 static void Main() {

     double doubleNum = 173737388856632566321737373676D;

     decimal decimalNum = 173737388856632566321737373676M;

   Console.WriteLine(doubleNum);

   Console.WriteLine(decimalNum);

 }

}

Explanation:

Given

See attachment for complete question

Required

Program to test double and decimal variables in C#

This declares and initializes double variable doubleNum

     double doubleNum = 173737388856632566321737373676D;

This declares and initializes double variable decimalNum (using the same value as doubleNum)

     decimal decimalNum = 173737388856632566321737373676M;

This prints doubleNum

   Console.WriteLine(doubleNum);

This prints decimalNum

   Console.WriteLine(decimalNum);

<em>As stated in the question, the above program will fail to compile because the decimal value is out of range.</em>

<em>To ensure that the program runs well, it's either the decimal value is reduced to within its range or it is comment out of the program.</em>

You might be interested in
Default tab stops are set in Word every _______ inch.<br> a. ¾<br> b. 1<br> c. ½<br> d. ¼
Oksi-84 [34.3K]
Half inch, I tested it lol
8 0
3 years ago
If you added the formula =SUM(B1:B5) to a spreadsheet, what would it do?
Vsevolod [243]

Answer:

C

Explanation:

Since you put "Sum" it will add

8 0
2 years ago
The item in this illustration that is highlighted is the _____. quick access tool bar view buttons status bar zoom control
tiny-mole [99]

Answer: scrollbar

Explanation:

7 0
3 years ago
Read 2 more answers
A developer is creating an enhancement to an application that will allow people to be related to their employer. Which data mode
vredina [299]

Answer:

B. Create a lookup relationship to indicate that a person has an employer

Explanation:

Programmers are professional who build computer softwares.

Creating a lookup relationship to indicate that a person has an employer is the data model used to track the data of a developer creating an enhancement to an application that will allow people to be related to their employer. This data model allows for 25people per object.

5 0
4 years ago
Write a CashRegister class that can be used with the RetailItem class that you wrote in Chapter 6's Programming Challenge 4. The
lys-0071 [83]

Answer:

Following are the code to this question:

import java.util.*; //import package for user input

class RetailItem//defining class RetailItem  

{

private String desc;//defining String variable

private int unit;//defining integer variable

private double prices;//defining double variable

RetailItem()//defining default Constructor

{

   //Constructor body

}

Output:

The Sub Total value: 199.75

The Sales Tax value: 11.985

The Total value: $211.735

Explanation:

In the above code three class "RetailItem, CashRegister, and Main" is defined, in the class "RetailItem", it defines three variable that is "desc, unit, and prices", inside the class "get and set" method and the constructor is defined, that calculates its value.

In the next step,  class "CashRegister" is defined, and inside the class parameterized constructor is defined, which uses the get and set method to return its value.  

In the next step, the main class is declared, in the main method two-class object is created and calls its method that are "getSubtotal, getTax, and getTotal".  

There is some technical error that's why full code can't be added so, please find the attached file of code.  

7 0
3 years ago
Other questions:
  • What could prevent earmuffs from providing your ears good protection from noise?
    10·1 answer
  • A provides an easy way for workers to interact with their computers
    9·1 answer
  • Suppose we are performing a binary search on a sorted array called numbers initialized as follows: // index 0 1 2 3 4 5 6 7 8 9
    9·1 answer
  • Digital certificates can be used for each of these EXCEPT _____. A. to encrypt channels to provide secure communication between
    13·1 answer
  • What is information technology
    11·1 answer
  • lance has three tables in his database. He wants to generate a report to show data from the three tables. Therefore, he decides
    7·2 answers
  • 6. According to camp policy, staff members need to be at least 23 years old to transport students. Dean now wants to determine h
    9·1 answer
  • Who has gotten a random file link from someone? What file does it contain?
    8·2 answers
  • Explain the major innavotions made from the establishment of abacus​
    8·1 answer
  • Which of the following is true of lossy and lossless compression techniques?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!