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
kumpel [21]
4 years ago
7

A cast is required in which of the following situations? a. using charAt to take an element of a String and store it in a char b

. storing an int in a float c. storing a float in a double d. storing a float in an int e. all of the above require casts
Computers and Technology
1 answer:
notka56 [123]4 years ago
3 0

Answer:

Option(d) i.e "storing a float in an int" is the correct answer for the given question.

Explanation:

  • Typecast is used for the changing the one datatype to the another datatype Their are two types of casting  

1 implicit

In this typecast we change the smaller datatype into the larger datatype.

For example

int to float  

2 Explicit  

In this typecast we change the larger datatype into the smaller datatype in an explicit manner.

For example

float to int.

  • in the given question we required the casting in the option(d) i.e "storing float in an int" That's why this option is correct and all other options are incorrect.
You might be interested in
Create a 4x5 matrix with ones everywhere and zeros on the last row.
Stells [14]

Answer:

#include <iostream>

using namespace std;

int main() {

   int a[4][5];//declaring a matrix of 4 rows and 5 columns.

   for(int i=0;i<4;i++)

   {

       for(int j=0;j<5;j++)

       {

           if(i==3)//initializing last row as 0.

           {

               a[i][j]=0;

           }

           else//initializing last row as 1.

           {

               a[i][j]=1;

           }

       }

   }

   for(int i=0;i<4;i++)

   {

       for(int j=0;j<5;j++)

       cout<<a[i][j]<<" ";//printing the matrix.

       cout<<endl;

   }

return 0;

}

Output:-

1 1 1 1 1  

1 1 1 1 1  

1 1 1 1 1  

0 0 0 0 0

Explanation:

I have created a matrix of size 4 rows and 5 columns.I have used for loops to fill the array.To fill the last row with 0 i have used if statement.else we are filling it with 1.

7 0
3 years ago
2) A language that changes code to machine-readable code one command at a time is known as what
iogann1982 [59]

Answer:

2) Interpreted programming languages (e.g. Python, Perl)

3) In computer science, the syntax of a computer language is the set of rules that defines the combinations of symbols that are considered to be correctly structured statements or expressions in that language. That means that the each programing language has its own specific rules.

4) Pseudocode

5) Cryptographic coding, examples: The Caesar shift, Kryptos

5 0
3 years ago
Write a program that passes an unspecified number of integers from command line and displays their total.
Svetradugi [14.3K]

Answer:

Explanation:

I will go straight to the code, and hope it didn't confuse you.

Here is it

public static void main(String[] args)

int [] x = new int [args.length]

for (int y = 0; y< args.length;yi++)

int[y] = (int) args [y]

5 0
3 years ago
Question 16 of 40
neonofarm [45]

Answer:

D hjjhhhhhhhhhhhhhhh

Explanation:

cuz

6 0
4 years ago
Read 2 more answers
A network administrator is required to upgrade wireless access to end users in a building. To provide data rates up to 1.3 Gb/s
soldi70 [24.7K]

Answer:

802.11ac

Explanation:

the newest wireless standard that provides data rates up to 1.3Gbps is the 802.11ac, its speed is three times faster than 802.11n and uses the 5GHz frequency range though there are some that uses 2.4GHz for dual support.

this Wireless standard has better features such as high speed file transfers and HD video streaming.

7 0
3 years ago
Other questions:
  • Which tool will be useful in darkening a subject’s hair color in a photograph? A.Dodge tool B.Burn tool C.Patch tool D.Blur tool
    5·2 answers
  • Why do most employers encourage their workers to invest in 401(k) accounts? (Site 1)
    14·2 answers
  • Write down the three part of a computer.<br>​
    7·1 answer
  • Which of the following is not an example of debugging? looking for errors in programming code. fixing misspelled commands in pro
    13·1 answer
  • How does applying Fontworks effects to text on an advertising flyer change the text?
    14·2 answers
  • Write a static method that takes a String and returns an integer. Return the number of characters in the passed in, String param
    6·1 answer
  • Color.
    9·1 answer
  • When a derived class method has the same name as a base class method, it is often said that the derived class method ________ th
    13·1 answer
  • Hey! I was recommended a site “9anime” the other day. All’s been going well but I accidentally taped on a new dub settingZ somet
    8·2 answers
  • (Synchronized threads) Write a program that launches 1000 threads. Each thread adds a random integer (ranging from 1 to 3, inclu
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!