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
Debora [2.8K]
2 years ago
9

should variables that contain numbers always be declared as integer or floating-point data types? why or why not? name potential

examples.
Computers and Technology
1 answer:
Stells [14]2 years ago
6 0

No, it is not necessary that variables that contain numbers should always be declared as integer or floating-point data types.

It is not necessary that variables that contain numbers should be declared as integer and floating point data types. Because number can be declared with different data types.  As we know that data type is a vital aspect in programming. It describes the type of a value that is contained in a variable. It is the data type based on which memory is allocated to a number or any type of variables.

Numbers can be whole decimal/fractional, signed, unsigned, small, and long. Simply, they exist in a variety of values. According to their values range, the amount of memory is reserved.

Different programming languages offer different data types to store numbers, depending on their types and size. Let’s consider some examples of data types used in programming languages in order to declare variables holding numbers.

  • In Python int, float, and complex are the data types used to declare number type variables.
  • SQL uses INTEGER, SMALLINT , BIGINT , NUMERIC() , and DECIMAL() data types for numbers.
  • To deal with number type variables, Java has six predefined data types, such as int, long, short, byte, float, and double.
  • JavaScript uses a single data type called 'number' to declare numbers.
  • In C++, two fundamental data types, int and float, are used to represent numeric variables. But C++ is not only limited to these two data types. The data type char can also store numbers. Other data types for declaring numbers as variables are derived from int, float and char, such as short int, long int, signed int, unsigned int, double, long double, signed char, unsigned char etc. etc.

So in concluding remarks, declaring a number type variable is not only limited to using integers and floating-points data types. Rather it entirely depends on the respective programming language, and size and type of the number to be stored in the variable.

You can learn more about data types at

brainly.com/question/13438922

#SPJ4

You might be interested in
Write a program to help a local restaurant automate its breakfast billing system. The program should do the following:
Maurinko [17]

Answer:

Please find the code and its output in the attached file:

Explanation:

In this code a structure "menuItemType" is defined that declared float and integer variable and outside the structure its list type variable "menuList" is defined that holds and calculates its value.

In the next step, a class "Rest" is defined, and inside the class a method "getData", "showMenu", and "printCheck" is defined, in which the above methods uses the switch for input and calculate the value and the last "printCheck" calculates the Tax and Amount Due value.

In the main method, a class object is created that prints message and call the above method.

6 0
3 years ago
What department is cyber security
Paul [167]

Answer:

United States Department of Homeland Security

The National Cyber Security Division (NCSD) is a division of the Office of Cyber Security & Communications, within the United States Department of Homeland Security's Cybersecurity and Infrastructure Security Agency.

<em>Give</em><em> </em><em>me</em><em> </em><em>brainliest</em><em> </em>

8 0
3 years ago
Read 2 more answers
4. Assume you have a list of numbers
navik [9.2K]

lst = [12,10,32,3,66,17,42,99,20]

a)

for x in lst:

   print(x)

b)

for x in lst:

   print(str(x) + " " +str(x**2))

I think this is what you're looking for. Hope this helps!

5 0
3 years ago
The tuning systems were not always reliable during the Baroque period. Why did composers use key signatures?
lapo4ka [179]

Key signatures were used because simply by knowing how many sharps or flats there were, the tuning would be more uniform. Tuning systems were not developed yet during the Baroque era and the concept of key was not introduced by then.

<span> </span>

7 0
4 years ago
You have a Windows 2016 Server with DFS. During normal operation, you recently experience an Event 4208. What should you do firs
Anna007 [38]

Answer: Increase your staging folder quota by 20%

Explanation:

The Distributed File System (DFS) allows the grouping of shares on multiple servers. Also, it allows the linking of shares into a single hierarchical namespace.

Since there's a Windows 2016 Server with DFS and during normal operation, an Event 4208 was experienced, the best thing to do in order to address the issue is to increase the staging folder quota by 20%.

6 0
3 years ago
Other questions:
  • It is important to keep a copy of your written plan and safety records off-site. A) True B) False
    6·2 answers
  • Which unique address is a 128-bit address written in hexadecimal?
    13·1 answer
  • How does Taylorism (scientific management used to streamline mass production) resemble a bureaucracy? Select one: a. Routinizati
    5·1 answer
  • who will follow me on tiktok and like all my videos? if you do ill give branlist and give u a shoutout and you can enter my big
    15·1 answer
  • When you click the Decrease Font Size button, Excel assigns the next highest font size in the Font Size gallery.
    8·1 answer
  • Describe a situation in which a robot may have to avoid an obstacle without coming to a complete stop before turning.
    10·2 answers
  • The point of (18 ,0) lies on​
    15·2 answers
  • 11 Select the correct answer. Which external element groups items in a design?
    9·1 answer
  • A computer cannot boot if it doesn't have ?
    9·2 answers
  • Say true or false. a)ICT in education is used as teaching learning aid
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!