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

Write a function named get_my_age that returns your age as an int (this is YOUR age, so if you were 21 you would return the numb

er 21). Note that this function takes no arguments and no input from the user. Call the function once and print the result. Reflect on the difference between creating a variable with a constant value and creating a function with no arguments that returns a constant return value.
Computers and Technology
1 answer:
d1i1m1o1n [39]3 years ago
5 0

Answer:

<em>The programming language is not stated; However, I'll answer this question using 2 programming languages (Python and C++)</em>

<em></em>

<em>Comments are used for explanatory purpose </em>

Python program starts here

def get_my_age():  #Declare function

      age = 21  #Assign value to age

      print(age)  #Print age

get_my_age() #Call function

#End of Program

C++ Programming Language starts here

#include<iostream>

using namespace std;

int get_my_age() //Declare Function

{

int age = 21; //Assign value to age

cout<<age; //Print age

}

int main()

{

get_my_age(); //Call Function

return 0;

}

You might be interested in
A device used to measure the pressure of an enclosed gas is a manometer.<br> a. True<br> b. False
Taya2010 [7]
Its true, check it out here 

manometer
nounan instrument for measuring the pressure acting on a column of fluid, consisting of a U-shaped tube of liquid in which a difference in the pressures acting in the two arms of the tube causes the liquid to reach different heights in the two arms.
4 0
3 years ago
Write javascript code for the form that appears in the image below. you are expected to add validation to the name field, email
bonufazy [111]
Hope this helps. Please rate. Thanks.

3 0
3 years ago
Read 2 more answers
What is a spark line? how is a different a chart​
Neporo4naja [7]

Answer:

A sparkline is a tiny chart in a worksheet cell that provides a visual representation of data.

5 0
3 years ago
The arrays list1 and list2 are identical if they have the same contents. Write a method that returns true if list1 and list2 are
Pani-rosa [81]

Answer:

See Explaination

Explanation:

import java.util.Arrays;

/**

*

* atauthor xxxx //replace at with the at symbol

*/

public class Test {

public static void main(String[] args) {

java.util.Scanner input = new java.util.Scanner(System.in);

// Enter values for list1

System.out.print("Enter list1: ");

int size1 = input.nextInt();

int[] list1 = new int[size1];

for (int i = 0; i < list1.length; i++)

list1[i] = input.nextInt();

// Enter values for list2

System.out.print("Enter list2: ");

int size2 = input.nextInt();

int[] list2 = new int[size2];

for (int i = 0; i < list2.length; i++)

list2[i] = input.nextInt();

if (equal(list1, list2)) {

System.out.println("Two lists are identical");

}

else {

System.out.println("Two lists are not identical");

}

}

public static boolean equal(int[] list1, int[] list2) {

if(list1.length == list2.length)

Arrays.sort(list1);

return true;

else

Arrays.sort(list2);

return false;

// Hint: (1) first check if the two have the same size.

// (2) Sort list1 and list2 using the sort method.

// (3) Compare the corresponding elements from list1 and list2.

// return false, if not match. Return true if all matches.

}

}

6 0
3 years ago
Consider the following code segment.
Gekata [30.6K]

Answer:

D

Explanation:

(n+n)(n+n)

(2n)^2

4n^2

8 0
3 years ago
Other questions:
  • A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost
    10·1 answer
  • Which of the following is powered by energy from earth's interior ?
    6·1 answer
  • How can you ensure you don't go over your budget?
    8·1 answer
  • You would like to know how many cells contain data. Which function should you use?
    11·1 answer
  • How do you use bold text?
    5·2 answers
  • Martina is responsible for the installation and maintenance of both hardware and software that make up her company’s network. Sh
    15·1 answer
  • etwork behavior analysis system __________ sensors are typically intended for network perimeter use, so they are deployed in clo
    10·1 answer
  • Jonathan is in the process of creating a photo of a fluttering flag with cars moving around in the background. He wants the flag
    13·2 answers
  • In this unit you have learned about ways to be faster at word processing. In 3 to 4 sentences, describe one or two skills
    9·1 answer
  • How do we distinguish between remote and local information sources? give an example of each source? i'll give brainliest answer
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!