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
Eva8 [605]
3 years ago
14

Write a program which asks the user for their name and age. The program should then print a sentence.

Computers and Technology
1 answer:
nikitadnepr [17]3 years ago
8 0

Answer:

name = input("What is your name? ")

age = int(input("What is your age? "))

print("%s is %d years old."% (name, age))

Explanation:

This is a solution in python.

You might be interested in
g (Locate the largest element) Write the following method that returns the location of the largest element in a two-dimensional
ruslelena [56]

Answer:

The method in JAVA is shown below.

static double largest = 0.0;

   static int[] idx = new int[2];

   public static int r = 20;

   public static int c = 20;

   public static int[] locateLargest(double[][] a)

   {

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

 {

     for(int k=0; k<r; k++)

     {

         if(largest<a[j][k])

         {

             largest=a[j][k];

             idx[0]=k;

             idx[1]=j;

         }

     }

 }

 return idx;

   }

The JAVA program is shown below.

import java.util.Scanner;

import java.lang.*;

class program

{

   //static variables declared and initialized as required

   static double largest = 0.0;

   static int[] idx = new int[2];

   public static int r = 20;

   public static int c = 20;

   public static int[] locateLargest(double[][] a)

   {

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

 {

     for(int k=0; k<r; k++)

     {

         if(largest<a[j][k])

         {

             largest=a[j][k];

             idx[0]=k;

             idx[1]=j;

         }

     }

 }

 return idx;

   }

}

public class Main

{

   static double[][] arr;

   static double input;

   public static void main(String[] args){

       program ob = new program();

       arr = new double[ob.r][ob.c];

    Scanner sc = new Scanner(System.in);

 for(int j=0; j<ob.c; j++)

 {

     for(int k=0; k<ob.r; k++)

     {

         arr[j][k]=0;

     }

 }

 System.out.println("Enter the elements of two dimensional array ");

 for(int j=0; j<ob.c; j++)

 {

     for(int k=0; k<ob.r; k++)

     {

         input = sc.nextDouble();

         if(input>0)

          {   arr[j][k] = input;

          //System.out.println(arr[j][k]);

          }

         else

             break;

     }

     break;

 }

 int[] large_idx = ob.locateLargest(arr);

       int row = large_idx[0];

 int col = large_idx[1];

 double l = arr[col][row];

 System.out.println("The largest element in the user entered array is " + l);

}

}

OUTPUT

Enter the elements of two dimensional array  

1

2

3

4

5

6

7

8

9

0

The largest element in the user entered array is 9.0

Explanation:

1. The class program contains the locateLargest() method as mentioned in the question.

2. The public class Main contains the main() method.

3. User input for array is taken inside main().

4. This array is passed to the locateLargest() method.

5. This method returns the one dimensional array having row and column indices of the largest element in the array.

6. The indices are used to display the largest element in the main().

8 0
3 years ago
Edward is a composer and needs to listen to the most accurate music files to create his compositions. What audio file type shoul
svetoff [14.1K]

Answer:

MP3

Explanation:

From the question we are informed about Edward who is a composer and needs to listen to the most accurate music files to create his compositions. In this case, the audio file type he should use to record his music is MP3 format. MP3 format Is an audio format which is a coding use in digital audio with high quality that can be used to store songs on the computer without taking much space, but with good quality. MP3 offer to listen to his/her music clearly.

4 0
3 years ago
Which of the following statements is true according to the code?
mihalych1998 [28]

Answer:

The #intro style applies to all paragraphs.

Explanation:

It is a class

A class applyies to all with that name

5 0
4 years ago
PLEASE HELP
Mrac [35]
1) B                                                                                                                         2) D
3) B
I hope I helped plz make me Brainliest if I'm right :)

8 0
4 years ago
Read 2 more answers
Does anyone else realize how the only tutor is for math never any other subjects?​
Slav-nsk [51]

Answer:

yes I do and I wonder why ??

7 0
3 years ago
Other questions:
  • The company involved in an attack by Oleg Zezev from Kazahkstan, in which Zezev accessed computer data and copied personal infor
    12·1 answer
  • "The pkill command terminates _________."
    14·1 answer
  • How many different messages can be transmitted in n microseconds using three different signals if one signal requires 1 microsec
    12·1 answer
  • Write a method swaparrayends() that swaps the first and last elements of its array parameter. ex: sortarray = {10, 20, 30, 40} b
    15·1 answer
  • In computer security, the term "Dumpster diving" is used to describe a practice of sifting through trash for discarded documents
    7·1 answer
  • Which of the following agricultural clusters would require administrative and financial training? biotechnology agribusiness sys
    8·1 answer
  • Which parts of the forebrain are sometimes described as the “executive center” and can be likened to the central processing unit
    9·1 answer
  • PLS HELP
    5·1 answer
  • Write the text of the program in Python.
    12·1 answer
  • How to get flash to work on chrome?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!