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
Anna71 [15]
2 years ago
11

Suppose your name was George Gershwin. Write a complete program that would print your last name, followed by a comma, followed b

y your first name. Do not print anything else (that includes blanks).
Computers and Technology
2 answers:
NNADVOKAT [17]2 years ago
6 0

Answer:

I will write the code in C++ and JAVA      

Explanation:

<h2>JAVA CODE</h2>

public class Main

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

       // displays Gershwin,George

     System.out.println("Gershwin,George"); }  }

<h2>C++ Code:</h2>

#include <iostream>

using namespace std;  

int main()

{  cout<<"Gershwin,George"; }    

// displays last name Gershwin followed by , followed by first name George

//displays Gershwin,George as output.

larisa86 [58]2 years ago
5 0
<h2>ANSWER</h2>

=> Code

public class Name{

    public static void main(String [ ] args){

          String firstname = "George";

          String lastname = "Gershwin";

          System.out.println(lastname + "," + firstname);

    }

}

=> Output

Gershwin,George

<h2>EXPLANATION</h2>

The code has been written in Java. The following is the line by line explanation of the code.

// Declare the class header

public class Name{

    // Write the main method for the code.

    public static void main(String [ ] args){

         

          // Declare a string variable called firstname and initialize it to hold the

          // first name which is <em>George</em>.

          String firstname = "George";

          // Declare a string variable called lastname and initialize it to hold the

          // last name which is <em>Gershwin</em>.

          String lastname = "Gershwin";

          // Print out the lastname followed by a comma and then the firstname

          System.out.println(lastname + "," + firstname);

    }      // End of main method

}           // End of class declaration

<h2></h2><h2>NOTE</h2>

The explanation of the code has been written above as comments. Please go through the comments of the code for more understanding.

Nevertheless, a few things are worth noting.

(i) Since it is a complete program, a main class (<em>Name</em>, in this case) has to be defined. The main class has a main method where execution actually begins in Java.

(ii) The first name (George) and last name (Gershwin) are both string values therefore they are to be stored in a String variable. In this case, we have used variable <em>firstname </em>to hold the first name and <em>lastname </em> to hold the last name. Remember that variable names must not contain spaces. So variable names <em>lastname </em>and <em>firstname</em>, though compound words, have been written without a space.

(iii)The System.out.println() method is used for printing to the console in Java and has been used to print out the concatenated combination of last name and first name separated by a comma.

(iv) In Java, strings are concatenated using the + operator. To concatenate two strings lastname and firstname, write the following:

lastname + firstname.

But since they are separated by a comma, it is written as:

lastname + "," + firstname

You might be interested in
a. STOP: What is a technology habit you practice today that you now realize will not help you to be successful? Explain why it’s
Zina [86]
A technology habit that I practice today that I realize will not help me to be successful is playing games on my phone. It’s important to stop doing this because instead of playing a game I could be doing more helpful things, like reading a book.
3 0
2 years ago
Read 2 more answers
Write a program named edit_data.py that asks a person their age. Accept an int. Use a custom exception to return a message if th
Katena32 [7]
An exception is an error that happens during the execution of a program. Exceptions are known to non-programmers as instances that do not conform to a general rule. The name "exception" in computer science has this meaning as well: It implies that the problem (the exception) doesn't occur frequently, i.e. the exception is the "exception to the rule". Exception handling is a construct in some programming languages to handle or deal with errors automatically. Many programming languages like C++, Objective-C, PHP, Java, Ruby, Python, and many others have built-in support for exception handling.

Error handling is generally resolved by saving the state of execution at the moment the error occurred and interrupting the normal flow of the program to execute a special function or piece of code, which is known as the exception handler. Depending on the kind of error ("division by zero", "file open error" and so on) which had occurred, the error handler can "fix" the problem and the programm can be continued afterwards with the previously saved data.
5 0
2 years ago
1.1.5 practice: analyzing business culture
USPshnik [31]

Answer:

 

A positive culture is an advantage when changes need to be made in the company. Making organisational changes and maintaining a positive culture a mutually complementary rather than mutually exclusive.

In a positive culture environment, people are happy and feel valued. When people feel happy and valued, it makes it easy for management to garner their buy-in cooperation when changes need to be made within the business.

In a culture that is negative, people don't feel valued and as such are always after their own interest rather than that of the company. There is also a tendency to always be on the defensive side of any change that is about to come looking out for one's self rather than what is best for the collective good. In this case, staff are much likely to sabotage new initiatives and changes rather than work to actuate them.

The obverse is true for a business with a positive culture.

Cheers!

3 0
2 years ago
Use the Manufacturing database from "Excel Databases.xls" on Blackboard. Use Excel to develop a multiple regression model to pre
Dennis_Churaev [7]

Answer:

52.64

Explanation:

Multiple Regression:

Multiple regression generally explains the relationship between multiple independent or predictor variables and one dependent or criterion variable.

Please kindly check attachment for the step by step solution of the given problem.

6 0
2 years ago
Select the correct text in the passage.
sergejj [24]

Answer:

2. Scientists use seismometers to measure the earthquake activity that occurs beneath a volcano. They then predict the eruption of that volcano.

Explanation:

The options are:

1. Before a volcano erupts, earthquake activity beneath the volcano decreases.2. Scientists use seismometers to measure the earthquake activity that occurs beneath a volcano. They then predict the eruption of that volcano.3. When a volcano erupts, the amount of carbon dioxide and sulfur dioxide emitted decreases. 4.Scientists measure the amount of these gases to determine the amount of magma present in the volcanic reservoir.

The answer is certainly 2. as seismometers are being used to find out the details of the earthquake activities which occur inside a volcano. And with this information, the volcanologists then predict the eruption of that particular volcano. Hence, the 2nd option does not have any factual errors, and all the others have factual errors.

5 0
2 years ago
Other questions:
  • True or false? The largest component of a database is a field.
    12·2 answers
  • "the ____ criteria filter requires the records displayed to have the specified text string anywhere."
    11·1 answer
  • A ____ partition contains the data necessary to restore a hard drive back to its state at the time the computer was purchased an
    8·2 answers
  • A form that dedicates a page for each item retrieved for a case; it allows investigators to add more detail about exactly what w
    10·1 answer
  • 1A network administrator notices that some newly installed Ethernet cabling is carrying corrupt and distorted data signals. The
    5·1 answer
  • Your reputation and credibility will be immediately destroyed if your website contains?
    8·2 answers
  • Explain how buyers and sellers factor into setting the stock price for a company’s shares.
    13·1 answer
  • Describe a situation involving making a copy of a computer program or an entertainment file of some sort for which you think it
    7·1 answer
  • Convert to octal. Convert to hexadecimal. Then convert both of your answers todecimal, and verify that they are the same.(a) 111
    12·1 answer
  • Imagine a business where there are no clear boundaries defined for data and systems ownership. As a security professional, descr
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!