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
Charra [1.4K]
3 years ago
8

Given an integer variable drivingAge that has already been declared, write a statement that assigns the value 17 to drivingAge .

Computers and Technology
1 answer:
lozanna [386]3 years ago
4 0

Answer:

The code to this question as follows:

Code:

#include <stdio.h> //include header file for using basic function

int main() //defining main method

{

int drivingAge = 17; //defining integer variable that assign a value

printf("%d\n",drivingAge);//print value.

return 0;  

}

Output:

17

Explanation:

In the above C language code, firstly a header file is included this file is used for use basic function. In the next line, the main function is defined, inside the main method, an integer variable "drivingAge" is declared that holds a value that 17 and to print variable value the printf function is used that prints its value.

You might be interested in
Which of the following would be a valid method call for the following method? public static void showProduct (int num1, double n
Alenkinab [10]

Answer:

showProduct(int,double)

for example: showProduct(10,10.5) is the correct answer even showProduct(10,10.0) is also correct but showProduct(10.0,10.5) or showProduct(10,10) or showProduct(10.0,10) are wrong calls.

Explanation:

The code is

  1.       <em>public static void showProduct (int num1, double num2){</em>
  2. <em>       int product;</em>
  3. <em>       product = num1*(int)num2;</em>
  4. <em>       System.out.println("The product is "+product);</em>
  5. <em>       }</em>

showProduct is function which asks for two arguments whenever it is called, first one is integer and second one is of type double which is nothing but decimal point numbers. Generally, in programming languages, 10 is treated as integer but 10.0 is treated as decimal point number, but in real life they are same.

If showProduct( 10,10.0) is called the output will be 'The product is 100'.

Strange fact is that, if you enter showProduct(10,10.5) the output will remain same as 'The product is 100'. This happens because in the 3rd line of code,which is <em>product=num1*(int)num2</em>, (int) is placed before num2 which makes num2 as of type integer, which means whatever the value of num2 two is given, numbers after decimal is erased and only the integer part is used there.

This is necessary in JAVA and many other programming languages as you <u>cannot</u><u> multiply two different datatypes</u> (here one is int and another is double). Either both of them should be of type int or both should be of type double.

3 0
3 years ago
Why do we allow electronic instruments to warm up before use?
son4ous [18]
Is not really a warm up!

we wait for the computer (electronic instrument) to load or process all the data in order to operate properly as its supposed to!
3 0
4 years ago
Does anyone know test 3 for edhesive computer science? (Not AP)
Svetach [21]

Answer:

nope srry

Explanation:

7 0
3 years ago
A _____ movement tries to improve a part of society, usually through legal methods.
arlik [135]

Answer:

Don’t know lol but look it up on g00gle and she will have the answr

Explanation:

3 0
3 years ago
Read 2 more answers
A document can contain either footnotes or endnotes but not both.<br> True<br> False
serg [7]
This is false. They can contain both.
6 0
3 years ago
Other questions:
  • The ___ is the primary storage device of a personal computer. hard drive RAM ROM compact disc
    6·1 answer
  • What type of socket should be used with an air impact wrench
    12·1 answer
  • I plugged my phone up into a charger, the charger sparked and i unplugged my phone and now it wont charge at all, does anyone kn
    13·1 answer
  • This loop is a good choice when you know how many times you want the loop to iterate in advance of entering the loop.1. do-while
    15·1 answer
  • Identify the operation which is NOT one of the parts of the fivebasic set operations in relational algebra?
    14·1 answer
  • What three things in the third generation of computing helped get programming enthusiasts more involved with computers? Select 3
    12·2 answers
  • A technician has been given a PC that is not powering up. After brief troubleshooting, the technician comes to the conclusion th
    14·1 answer
  • A=1/2h(a+b) solve for h
    6·1 answer
  • Where is the "delete account" button in my profile? And please give me a legit answer and not just a word.
    10·2 answers
  • In what way , if any, can your social media presence affect your chances of getting a job in social media?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!