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]
4 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]4 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 network technician has configured a point-to-point interface on a router. Once the fiber optic cables have been run, though, t
masya89 [10]

Answer:

Wavelength Mismatch

Explanation:

Optical fiber cables are used because they have lowest attenuation(loss of signal strength).

Attenuation is directly proportional to wavelength.

According to me this issue is most likely caused by Wavelength mismatch.If the wavelength of the signal is high then there is more attenuation in that signal.

6 0
3 years ago
PLS HELP ASAP ILL GIVE BRAINLKEST THANKS ITS FOR TODAY
ANTONII [103]
Do u have context for the question? Based off of my brain alone, I would eliminate good food as an answer. I’d assume the answer to the second question is code.
8 0
3 years ago
What are some of the strategies that you use for confronting a complex problem and breaking it down into smaller pieces? How mig
bazaltina [42]

Answer:

Breaking it down I guess for me, you could take down all the possible things that you could do. Eliminating things, one by one. It could help working on a computer by not letting yourself get over-whelmed by all your programming and thinking "alright, this THEN this."

Explanation:

8 0
3 years ago
4
kupik [55]

Answer:

the answer is D Smart Object

5 0
3 years ago
Read 2 more answers
What is one distinguishing feature of Italian opera buffa in comparison to comic opera of other countries?
vodka [1.7K]

Answer:

It is sung throughout.

Explanation:

5 0
3 years ago
Other questions:
  • The set of specific, sequential steps that describe exactly what a computer program must do to complete the work is called a(n _
    14·1 answer
  • What are MS Word's default tabs?
    5·2 answers
  • Make a program that prints each line of its input that mentions fred. (It shouldn’t do anything for other lines of input.) Does
    10·1 answer
  • User authentication is a procedure that allows communicating parties to verify that the contents of a received message have not
    12·1 answer
  • You wish to enter your exam scores in a spreadsheet. Which function will help you find how each subject’s score relates to the o
    15·2 answers
  • Consider the relational schema below: Students(sid: integer, sname: string, major: string) Courses(cid: integer, cname: string,
    9·1 answer
  • Differents<br>DIFFE<br>RENTIATE BETWEEN FORMULA &amp; A FUNCTION Giving Example​
    8·1 answer
  • What is Ce stands for?
    8·1 answer
  • Which skill type refers to the ability to interact and communicate effectively with people? skills refer to the ability to inter
    8·2 answers
  • Which area located at the top of the word screen includes home , insert , and page layout ?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!