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
Nikolay [14]
2 years ago
8

Assume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra" and "Zoe") and ages respect

ively. Write some code that reads in a name and an age and then prints the message "The age of NAME is AGE." where NAME and AGE are replaced by the values read in for the variables name and age. For example, if your code read in "Rohit" and 70 then it would print out "The age of Rohit is 70", on a line by itself. There should not be a period in the output.
Computers and Technology
1 answer:
shutvik [7]2 years ago
3 0

Answer:

I will write the code in C++ and JAVA                    

Explanation:

<h2>C++ Program:</h2>

#include <iostream>

using namespace std;

int main()

{ std::string NAME;  

// i have used std::string so that the input name can be more than a single character.

std::cout << " enter the name"; // take an input name from user

std::getline(std::cin,NAME);

int AGE;

       cout<<"Enter age";  //takes age from the user as input

       cin>>AGE;

   cout<<"The age of "; std::cout <<NAME; cout<< " is " << AGE; }

/* displays the message for example the name is George and age is 54 so    message displayed will be The age of George is 54 and this will be displayed without a period */

<h2>Explanation:</h2>

The program first prompts the user to enter a name and the asks to input the age of that person. As per the requirement the if the user enter the name George and age 54, the program displays the following line as output:

The age of George is 54

Here  std::string is used so that the input string can be more than one character long.

<h2>JAVA code</h2>

import java.util.*;

public class Main

{ public static void main(String[] args) {

String NAME;

Scanner sc = new Scanner(System.in);

System.out.println("Enter a name:");

NAME= sc.nextLine();

int AGE;

Scanner scanner = new Scanner(System.in);

System.out.println("Enter age:");

AGE = Integer.parseInt(scanner.nextLine());

System.out.print("The age of " + NAME + " is " + AGE); }}

<h2>Explanation:</h2>

This is the JAVA code which will work the same as C++ code. The scanner class is used to read the input from the user. The output of the above JAVA code is as follows:

Enter a name: George

Enter age: 45

The age of George is 45

You might be interested in
Which type of worker would most likely be able to begin work after receiving a high school degree and completing an
makvit [3.9K]
I’m pretty sure it’s miner

“I’ll give you head I mean brainiest”
3 0
2 years ago
Declare a character variable letterStart. Write a statement to read a letter from the user into letterStart, followed by stateme
oee [108]
  1. Answer: import java.util.Scanner; public class CharTestt {     public static void main(String[] args) {     System.out.println("Please enter a character ");     Scanner input = new Scanner(System.in);     char letterStart = input.next().charAt(0);     char thenextChar = (char)(letterStart+1);     System.out.print(letterStart);     System.out.println(thenextChar); } } Explanation: Import Scanner Class Prompt user to enter a character Read and save user's input in a variable char letterStart = input.next().charAt(0); Knowing that the next character using ASCII is +1, create a new character variable and add 1 print the character entered and the new character all on same line without spaces
5 0
3 years ago
Question 4 1 pts The following code could be rewritten using: if (x &gt; 12): if (x &lt; 34):​
artcher [175]

Answer:

if(x>12 || x<34)

Explanation:

Mashing the two together using the or '||' operator would allow to run both necessary functions for the next code.

7 0
2 years ago
What would you have to know about the pivot columns in an augmented matrix in order to know that the linear system is consistent
Scrat [10]

Answer:

The Rouché-Capelli Theorem. This theorem establishes a connection between how a linear system behaves and the ranks of its coefficient matrix (A) and its counterpart the augmented matrix.

rank(A)=rank\left ( \left [ A|B \right ] \right )\:and\:n=rank(A)

Then satisfying this theorem the system is consistent and has one single solution.

Explanation:

1) To answer that, you should have to know The Rouché-Capelli Theorem. This theorem establishes a connection between how a linear system behaves and the ranks of its coefficient matrix (A) and its counterpart the augmented matrix.

rank(A)=rank\left ( \left [ A|B \right ] \right )\:and\:n=rank(A)

rank(A)

Then the system is consistent and has a unique solution.

<em>E.g.</em>

\left\{\begin{matrix}x-3y-2z=6 \\ 2x-4y-3z=8 \\ -3x+6y+8z=-5  \end{matrix}\right.

2) Writing it as Linear system

A=\begin{pmatrix}1 & -3 &-2 \\  2& -4 &-3 \\ -3 &6  &8 \end{pmatrix} B=\begin{pmatrix}6\\ 8\\ 5\end{pmatrix}

rank(A) =\left(\begin{matrix}7 & 0 & 0 \\0 & 7 & 0 \\0 & 0 & 7\end{matrix}\right)=3

3) The Rank (A) is 3 found through Gauss elimination

(A|B)=\begin{pmatrix}1 & -3 &-2  &6 \\  2& -4 &-3  &8 \\  -3&6  &8  &-5 \end{pmatrix}

rank(A|B)=\left(\begin{matrix}1 & -3 & -2 \\0 & 2 & 1 \\0 & 0 & \frac{7}{2}\end{matrix}\right)=3

4) The rank of (A|B) is also equal to 3, found through Gauss elimination:

So this linear system is consistent and has a unique solution.

8 0
2 years ago
Your boss asks you to transmit a small file that includes sensitive personnel data to a server on the network. The server is run
mel-nik [20]

Answer:

a. Telnet transmissions are not encrypted.

Explanation:

Indeed, since <em>Telnet transmissions are not encrypted,</em> all the information sent, and even the characters typed in the telnet console are sent in clear text.

This is a security issue, since any other device in the same network will receive a copy of the information (packets) sent. For default, all the devices, except for the server expecting to receive the information, will discard the packets. However it is easy to actively <em>listen </em>and keep those packets, wich will contain the information in plain text and human readable.

4 0
3 years ago
Other questions:
  • Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to beco
    11·1 answer
  • A small company has hired you to take over its IT needs. The company currently has seven on-site employees and 12 remote employe
    12·1 answer
  • James, a technician, needs to format a new drive on a workstation. He will need to configure read attributes to specific local f
    5·1 answer
  • The main parts of a lever are the....
    6·2 answers
  • What is the keyboard shortcut to display the merge to printer dialog box?
    5·1 answer
  • Digital certificates can be used for each of these EXCEPT _____. A. to encrypt channels to provide secure communication between
    13·1 answer
  • Some numbers are formed with closed paths. the digits 0, 4, 6 and 9 each have 1 closed path and 8 has 2. None of the other numbe
    6·1 answer
  • Which of the following is part of the 6-by-6 rule?<br><br> i need help!!!!!
    5·1 answer
  • List safety conditions when downloading shareware, free free where, or public domain software
    14·1 answer
  • 3. Coaxial/telephone cable sends<br> during the data transmission<br> signal
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!