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
Ksivusya [100]
3 years ago
11

What is wrong with the following declaration? How should it be fixed?

Computers and Technology
1 answer:
GalinKa [24]3 years ago
6 0

Answer:

We have used int datatype which is wrong in the given declaration.

The correct declaration is public static final double myNumber = 17.36;

Explanation:

In this declaration the value is stored in "myNumber" variable is 17.36 which is decimal point number to store the decimal point number we have to use the double datatype, not int datatype because int datatype can store only integer value not the decimal value. So we have to use the double datatype instead of int type.

The correct syntax for the following declaration is :

public static final double myNumber = 17.36;

You might be interested in
Organizational behavioural aspects
zzz [600]

Answer:

Organizational behavior aspects are the points of view represented by external environments, including people and technology. We can make improvements to our physical aspects by using this particular aspect to understand how everyday elements interact with one another.

5 0
2 years ago
Write an HLA Assembly language program that prompts for a specific int8 value named n and then displays a repeated digit pattern
yan [13]

Answer:

Output:

123456

123456

123456

123456

123456

123456

Explanation:

C Code:

#include <stdio.h>

int main() {

int n,i,j;

printf("Gimme a decimal value to use as n:");

scanf("%d",&n);

for(i=0;i<n;i++){

for(j=1;j<=n;j++){

printf("%d",j);

}

printf("\n");

}

return 0;

}

Equivalent assembly program:

.LC0:

.string "Gimme a decimal value to use as n:"

.LC1:

.string "%d"

main:

push rbp

mov rbp, rsp

sub rsp, 16

mov edi, OFFSET FLAT:.LC0

mov eax, 0

call printf

lea rax, [rbp-12]

mov rsi, rax

mov edi, OFFSET FLAT:.LC1

mov eax, 0

call scanf

mov DWORD PTR [rbp-4], 0

.L5:

mov eax, DWORD PTR [rbp-12]

cmp DWORD PTR [rbp-4], eax

jge .L2

mov DWORD PTR [rbp-8], 1

.L4:

mov eax, DWORD PTR [rbp-12]

cmp DWORD PTR [rbp-8], eax

jg .L3

mov eax, DWORD PTR [rbp-8]

mov esi, eax

mov edi, OFFSET FLAT:.LC1

mov eax, 0

call printf

add DWORD PTR [rbp-8], 1

jmp .L4

.L3:

mov edi, 10

call putchar

add DWORD PTR [rbp-4], 1

jmp .L5

.L2:

mov eax, 0

leave

ret

Input:

6

The program was first written with a c code, anf and subsequently translated to an assembly language.

3 0
3 years ago
Define a function that takes two arguments: a string called strText and a number called intNumber. This function will use a repe
natima [27]

Answer:

public class Main

{

   public static void printString(String strText, int intNumber) {

       for(int i=0; i<intNumber; i++){

           System.out.println(strText);

       }

   }

   

public static void main(String[] args) {

       

       printString("Brainly", 3);

}

}

Explanation:

- Define a function called <em>printString</em> that takes two parameters - a String and an int. Since the function will print out the given String, it's type will be <u>void</u>.

- Use <em>for loop</em> to iterate according to the given number and print the given string

- In the main, call the <em>printString </em>function with some parameters.

3 0
4 years ago
Read 2 more answers
What is life all about?
zloy xaker [14]
Life can be about anything........
8 0
3 years ago
Read 2 more answers
2. Imagine you play a game of fetch with the dog. It takes the dog 60 seconds to run a total of 180 meters. What was the dog's a
vodka [1.7K]

180 meters in 60 seconds is an average speed of 180m/60s = 3 m/s.

3 0
4 years ago
Other questions:
  • In memory ads for DIMMs, you notice DDR 2400 CL15 in one ad and PC4 21300 CL9 in another. Which ad is advertising the faster mem
    12·1 answer
  • What is the difference between a router and a modem
    15·1 answer
  • Is bit stuffing necessary in the control or address field in theHDLC protocol? why?
    13·1 answer
  • Digital Photography Help please
    9·2 answers
  • Write a Python function merge_dict that takes two dictionaries(d1, d2) as parameters, and returns a modified dictionary(d1) cons
    5·1 answer
  • TCP will guarantee that your packets will arrive at the destination, as long as the connection is still established. True False
    11·1 answer
  • we studied FIFO, Priority, Round Robin (RR), and Weighted Fair Queueing (WFQ) packet scheduling disciplines. Which of these queu
    12·1 answer
  • In a nondatabase, file-oriented environment, data is often partitioned into several disjointed systems with each system having i
    11·1 answer
  • How can I, fill the application form for jobs. [such as Macdonal's jobs].?
    12·1 answer
  • 1 bulb controlled by 2-three way switches using 12 volts battery.<br><br> pahelp po
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!