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
A computer system designed to run games is called a
Maru [420]

A computer system designed to run games is called a game console.

3 0
3 years ago
Read 2 more answers
Why is this happening when I already uploaded files to my drive?
lara31 [8.8K]

Answer:

u have to upload it to your drive first

Explanation:

7 0
2 years ago
What do you need to do to make the LED light up?
Yanka [14]

Answer:

provide electricity .

Explanation:

The LED light glows when current flows through it .

<em><u>Additional</u></em><em><u> </u></em><em><u>i</u></em><em><u>n</u></em><em><u>f</u></em><em><u>o</u></em><em><u>r</u></em><em><u>m</u></em><em><u>a</u></em><em><u>t</u></em><em><u>i</u></em><em><u>o</u></em><em><u>n</u></em>

  • The full form of LED is light emitting diode .
  • It is a semi conductor .
  • It has many advantages as it uses less amount of current .
6 0
3 years ago
Pls help help i will give brainliest help pls​
Veronika [31]

Answer:

3 or 2

Explanation:

8 0
3 years ago
What are the objects in object-oriented programming language?
VMariaS [17]

Answer:

An object is an abstract data type with the addition of polymorphism and inheritance. Rather than structure programs as code and data, an object-oriented system integrates the two using the concept of an "object". An object has state (data) and behavior (code). Objects can correspond to things found in the real world.

hope it helps ya mate.

5 0
3 years ago
Other questions:
  • In a spreadsheet, there are many features that help you edit quickly. True False
    11·1 answer
  • Demote the "Arrive and leave at the same time each day." List item, and then promote the "Respect" list item.
    6·1 answer
  • Research 3 distributions that utilize the big data file systems approaches, and summarize the characteristics and provided funct
    7·1 answer
  • Hello everyone. I need help. C programming. Create at least two more functions except the main () function to collect them.
    5·1 answer
  • A(n) ________ moves over the spinning platters to retrieve data from the hard disk.
    6·1 answer
  • When creating a chart or graph, which should be completed first?
    9·2 answers
  • Which of these are examples of a bug?
    6·1 answer
  • Write a program to find the sum of first 10 even numbers in qbasic​
    15·1 answer
  • "En la opción
    10·1 answer
  • Your friend decides to create a spreadsheet containing vocabulary terms and their definitions to help prepare for the unit test
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!