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
SashulF [63]
3 years ago
5

You would like the user of a program to enter a customer’s last name. Write a statement thaUse the variables k, d, and s so that

they can read three different values from standard input--an integer, a float, and a string respectively. On one line, print these variables in reverse order with exactly one space in between each. On a second line, print them in the original order with one space in between them.t asks user "Last Name:" and assigns input to a string variable called last_name.

Computers and Technology
1 answer:
mojhsa [17]3 years ago
6 0

Answer:

1st question:

Use the variables k, d, and s so that they can read three different values from standard input an integer, a float, and a string respectively. On one line, print these variables in reverse order with exactly one space in between each. On a second line, print them in the original order with one space in between them.

Solution:

In Python:

k = input()  #prompts user to input value of k i.e. integer value

d = input()  #prompts user to input value of d i.e. float value

s = input()  #prompts user to input value of s i.e. a string

print (s, d, k)  #displays these variable values in reverse order

print (k, d, s)#displays these variable values in original order

In C++:

#include <iostream>    // to use input output functions

using namespace std;   //to identify objects like cin cout

int main() {    //start of main function

  int k;   //declare int type variable to store an integer value

  float d; //  declare float type variable to store a float value

  string s;   //  declare string type variable to store an integer value

  cin >> k >> d >> s;    //reads the value of k, d and s

  cout << s << " " << d << " " << k << endl;     //displays these variables values in reverse order

  cout << k << " " << d << " " << s << endl;   } // displays these variable values in original order

Explanation:

2nd question:

You would like the user of a program to enter a customer’s last name. Write a statement that asks user "Last Name:" and assigns input to a string variable called last_name.

Solution:

In Python:

last_name = input("Last Name:")

# input function is used to accept input from user and assign the input value to last_name variable

In C++:

string last_name;  //declares a string type variable named last_name

cout<<"Last Name: ";  // prompts user to enter last name by displaying this message Last Name:

cin>>last_name; // reads and assigns the input value to string variable last_name

The programs alongwith their outputs are attached.

You might be interested in
What is SEO?<br> Training Live Online Instructor-Led Learning, https://www.peoplentech.com.bd/<br> ,
evablogger [386]

Answer:Search engine optimization (SEO) is the process of optimizing your online content so that a search engine likes to show it as a top result for searches of a certain keyword. ... When it comes to SEO, there's you, the search engine, and the searcher.

Explanation:

4 0
2 years ago
Which of the following is the largest disadvantage of wind power?
nydimaria [60]
The answer is     C.wind machines only generate electricity when wind is blowing
3 0
3 years ago
Read 2 more answers
Which of the following do you need to remeber about true/false questions?
lina2011 [118]
All parts of a statement must be true for it to be true
7 0
3 years ago
What year was internet inverted
alex41 [277]

\large\blue{\mid{\underline{\overline{\tt { →\:January \:1, 1983}\mid}}}}

  • ARPANET→Advanced Research Projects Agency Network
  • the forerunner of the Internet.

\purple{\rule{15mm}{2.9pt}} \red{\rule18mm{2.5pt}} \orange{ \rule18mm{2.5pt}}

\sf{\:мѕнαcкεя\: ♪...}

5 0
1 year ago
What is a dbms in full
Alika [10]

database management system

5 0
2 years ago
Other questions:
  • A DTP firm has published and printed flyers for an upcoming fundraising event. In which section of the flyer would you find the
    6·2 answers
  • Create an interactive program to use class a LightsOut class to allow a user to play a game. Each step in the game will require
    6·1 answer
  • Citing the recent increase in earnings by several computer companies, economists feel that a cycle has begun in which personal c
    13·1 answer
  • Write a method for the Invitation class that accepts a parameter and uses it to update the address for the event.
    9·1 answer
  • Program 3.Study the code carefully and write out the line where there is error, debug it and write out the correct code
    13·1 answer
  • 3. Special keys labelled Fl to F12.
    8·1 answer
  • Your location has been assigned the 172.149.254.0 /24 network. You are tasked with dividing the network into 13 subnets with the
    12·1 answer
  • A computer has __________processing device
    13·1 answer
  • Five types of conflict in the school​
    9·2 answers
  • Why is color important for all objects drawn ?​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!