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
Anna71 [15]
4 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]4 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]4 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
If you look at a white object through a glass of any color, it must appear to remain white.
vodomira [7]
False. It will appear the colour of the glass, but just a bit lighter. It’s like looking through floured water or a balloon
4 0
3 years ago
1. provides a list of at least five SSIDs and the
taurus [48]

One of the most important ways to provide wireless security is through:

  • The use of encryption.

<h3>What is Wireless Security?</h3>

This refers to the network authentication and use of encryption to secure a network from unauthorized access or compromise of the network by an external agent.

With this in mind, we can see that SSID is a WiFi network name and it makes use of WPA2 security encryption to protect the wireless network through wireless encryption protocol.

Please note that your question is incomplete so I gave you a general overview to help you get a better understanding of the concept.

Read more about wireless security here:
brainly.com/question/14449935

8 0
2 years ago
Elena is starting a new nonprofit organization that provides professional-looking clothes for women who need to go on job interv
frutty [35]

Answer:

Excel is a multipurpose program that is useful in many different ways and not just in payroll. It has uses from Accounting to scientific research and everything in-between.

Elena might not need it for payroll but there are other ways to use Excel such as:

  • Database of Donor details - Elena can use Excel to keep a list of the businesspeople who donate their old clothes to the organization. She can also add details to these names such as when they donated, the frequency at which they have donated, what they donated and the like. The donor details will therefore be organized such that information on donors can be easy to acquire for whatever reason it is needed for.
  • Inventory - Excel can be used to keep an inventory list of the clothes that the organization has in stock. This will enable them better serve those they want to help as well as ensuring accountability in the workplace. A well kept inventory list will enable all sorts of analysis to be carried out such as which types of clothes are most in stock, which clothes are needed, which clothes are preferred and the like.
3 0
3 years ago
Describe three ways to protect the computer and all peripheral devices from damage
omeli [17]

Here are three ways:

Cleaning: as applied to most things in our lives, cleaning also applies to protecting peripheral devices. To ensure the smooth running of such devices one needs to clean the dust and dirt from these devices once in a while. Make sure you disconnect the device before you eject it from the system.<span>

Follow instructions: Most devices come with a safety guide and instructions manual, always use the recommended settings for the smooth running of your system. These recommendations usually come from the manufacturer and are reliable.

<span>Surge suppressor/protector: One of the major issues faced by the users is faults caused by power surges. One needs to make sure to use a Surge Suppressor/Protector connected with the system to make sure it will not damaged with power fluctuations. </span></span>

3 0
4 years ago
a.Write a Python function sum_1k(M) that returns the sum푠푠= ∑1푘푘푀푀푘푘=1b.Compute s for M = 3 by hand and write
stealth61 [152]

Answer:

def sum_1k(M):

   s = 0

   for k in range(1, M+1):

       s = s + 1.0/k

   return s

def test_sum_1k():

   expected_value = 1.0+1.0/2+1.0/3

   computed_value = sum_1k(3)

   if expected_value == computed_value:

       print("Test is successful")

   else:

       print("Test is NOT successful")

test_sum_1k()

Explanation:

It seems the hidden part is a summation (sigma) notation that goes from 1 to M with 1/k.

- Inside the <em>sum_1k(M)</em>, iterate from 1 to M and calculate-return the sum of the expression.

- Inside the <em>test_sum_1k(),</em> calculate the <em>expected_value,</em> refers to the value that is calculated by hand and <em>computed_value,</em> refers to the value that is the result of the <em>sum_1k(3). </em>Then, compare the values and print the appropriate message

- Call the <em>test_sum_1k()</em> to see the result

8 0
3 years ago
Other questions:
  • I plugged my headphones into my computer, but the sound still came out of the speakers. help!
    12·2 answers
  • You are a member of the Administrators group on all company computers. You are having difficulty changing permissions for a fold
    11·1 answer
  • Given a normally distributed data set of 500 observations measuring tree heights in a forest,
    6·1 answer
  • Modify the definition of the throttle class on page 35, to create a new throttle ADT, which allows the user of the ADT to specif
    6·1 answer
  • why might a portrait be both a portrait of the subject and the photographer? how is a photographer present in a portrait?
    10·2 answers
  • The UML models operations by listing the operation name preceded by an access modifier. A(n) ________ indicates a public operati
    7·2 answers
  • For the client-server application over TCP, why must the server program be executed before the client program? For the client se
    13·1 answer
  • What are the correct steps to find the system specifications such as the amount of RAM or system type?
    13·1 answer
  • Which search phrase is the most effective to find out about the most popular pizza chains worldwide in 2019?
    14·1 answer
  • Does anyone know what's wrong with this code in Unity? HELP FAST PLEASE! This is for my game design course, I will give brainies
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!