answer.
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
Novosadov
22 days ago
10

CHALLENGE ACTIVITY 2.15.1: Reading and outputting strings. Write a program that reads a person's first and last names, separated

by a space. Then the program outputs last name, comma, first name. End with newline. Example output if the input is: Maya Jones Jones, Maya 1 2 3 4 5 6 7 8 9 10 11 12 #include #include using namespace std; int main() { string firstName; string lastName; /* Your solution goes here */ return 0; } 1 test passed All tests passed Run
Computers and Technology
1 answer:
Harlamova29_29 [932]22 days ago
8 0

Response:

#include <iostream>

using namespace std;

int main()

{

   string Fname, Lname;

   cout << "Please enter your first name " <<"Please enter your last name" <<endl;

   cin>>Fname>>Lname;

   cout<<Lname<<", "<<Fname<<endl;

   return 0;

}

Clarification:

This code is coded in the C++ programming language. To begin with, two string variables are declared, namely Fname and Lname for the first and last names, respectively. The C++ cout function is utilized to ask users for their inputs, while the cin function takes in user inputs and stores them in the corresponding variables. The cout operator (<<) arranges the output in accordance with the specification given in the question

You might be interested in
Compute the approximate acceleration of gravity for an object above the earth's surface, assigning accel gravity with the result
maria [879]

Response:

Written in Python

G = 6.673 *pow(10,-11)

M = 5.98 *pow(10,24)

d = float(input("Enter distance: "))

g = (G * M)/(pow(d,2))

print("Calculated gravity acceleration: "+str(g))

Explanation:

The following line sets the gravitational constant

G = 6.673 *pow(10,-11)

This line establishes the mass of the Earth

M = 5.98 *pow(10,24)

This prompts the user to input the object's distance

d = float(input("Enter distance: "))

This calculates the gravity exerted on the object

g = (G * M)/(pow(d,2))

This line outputs the gravity acceleration without rounding

print("Calculated gravity acceleration: "+str(g))

8 0
1 month ago
A network administrator notices that some newly installed Ethernet cabling is carrying corrupt and distorted data signals. The n
zubka84 [945]

Answer:

EMI and RFI

Explanation:

EMI, or Electromagnetic Interference, can also be referred to as Radio-frequency Interference (RFI) within the radio frequency domain.

An unshielded ethernet cable, made from copper, might function as an antenna; any external noise that interferes with it can corrupt the data signal, resulting in data integrity issues and distorted signals.

6 0
8 days ago
if you had two proxy servers located in the same room, what use could you make of them? nothing create a hub sell one of the ser
Harlamova29_29 [932]
Establish a free wifi service
6 0
1 month ago
Read 2 more answers
Write an application that throws and catches an ArithmeticException when you attempt to take the square root of a negative value
Harlamova29_29 [932]

The code relevant to the problem in question:

import java.util.Scanner;

public class Test {

   public static void main(String[] args) {

       double number;

       double squareRootOfNumber;

       String userInput = null;

       Scanner scanner = new Scanner(System.in);

       System.out.println("Please enter a number: ");

       userInput = scanner.next();

       number = Double.parseDouble(userInput);

       squareRootOfNumber = Math.sqrt(number);

       if (number < 0) {

           throw new ArithmeticException("Cannot compute the square root of a negative number");

       }

       System.out.format("The square root of the entered number is %.2f %n", squareRootOfNumber);

   }

}

The program will output:

Please enter a number:

-90

Exception in thread "main" java.lang.ArithmeticException: Cannot compute the square root of a negative number at com..ans.Test.main(Test.java:18)

Explanation:

The standard Java library function java.lang.Math.sqrt does not throw an ArithmeticException for negative arguments, hence there’s no need to enclose your code in a try/catch block.

Instead, we manually trigger ArithmeticException using the throw keyword:

throw new ArithmeticException("Cannot compute the square root of a negative number");

3 0
1 month ago
CodeLab Question
Rzqust [894]

Response:

I am not familiar with coding languages, but I can demonstrate how you might do it in Python

myAlarm():

   arm = True

   code = "secret message"

myAlarm()

main():

deactivate = input(">>> ")

if deactivate = myAlarm.code:

  arm = False

I still feel a bit unclear about the question.

(I work as a game developer and code daily)

3 0
11 days ago
Other questions:
  • 7. Which of these statements is true? Agile is a programming language MySQL is a database HTML stands for "Hypertext Markup Link
    15·1 answer
  • For Adults/Adolescents, you should call/activate EMS: Before providing CPR. After providing CPR for 2 minutes. After an AED has
    13·1 answer
  • The video clip on driverless cars explained that brain signals from the individual wearing the headset are converted by computer
    13·2 answers
  • This question involves a simulation of a two-player game. In the game, two simulated players each start out with an equal number
    7·1 answer
  • To finish creating a design for the webpage, use one shape to cut away part of the other. Create a 700 pixel by 700 pixel square
    10·1 answer
  • A computer program is tested by 5 independent tests. If there is an error, these tests will discover it with probabilities 0.1,
    5·1 answer
  • Xem tập các tiến trình sau đây, với thời gian cần chạy ở cột Burst Time được cho ở đơn vị mili giây.
    10·1 answer
  • 6. A small design agency you are consulting for will be creating client websites and wants to purchase a web server so they can
    6·1 answer
  • Write a loop to populate the list user_guesses with a number of guesses. The variable num_guesses is the number of guesses the u
    13·1 answer
  • The Online Shopping system facilitates the customer to view the products, inquire about the product details, and product availab
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!