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
Which of these is NOT one of the three parts to the event-handling mechanism in Java?
Tamiku [17]

Answer:Event action

Explanation:Event-handling mechanism is the technique through which the  the management of any event is Java is controlled and coordinated. The event handler code is used for the managing of the mechanism and execution.

Event action is not a part of the event handling mechanism in the java because no such step comes under the code of event handler and rest other option are present in java event handler.

5 0
2 years ago
There are two main types of hard drive available to a computer. State what they are and describe their use.
Gala2k [10]

Answer:

Hard disk drives (HDD), which use one or more rotating discs and rely on magnetic storage, and solid-state drives (SSD), which have no moving mechanical parts, but use flash memory like the kind found in USB flash drives.

Explanation:

6 0
2 years ago
This OS was created by a developer named Torvalds.
GREYUIT [131]
The answer to this problem is Linux
7 0
3 years ago
I got a 52 on my test :(
Eduardwww [97]

Answer:

that sucks i hope u can do better next time have a good day

Explanation:

7 0
3 years ago
List three different computer languages, and describe how each one is used in software development
Bumek [7]
JavaScript- Used in designing websites

Python- Used in developing desktop and web applications

C++ Used in Video games, operating systems such as Windows 10, and device drivers.
6 0
3 years ago
Other questions:
  • In a spreadsheet, there are many features that help you edit quickly. True False
    11·1 answer
  • Which one of the following items is an example of software?
    12·2 answers
  • Write a method body for the static method isDivisibleBy5 shown below. The only NaturalNumber methods you are allowed to use are
    12·1 answer
  • An IT professional with a customer-service
    13·1 answer
  • Please tell fast plzzzzzzzz​
    11·2 answers
  • What is the code i need to do
    12·1 answer
  • Time shifting occurs when
    8·2 answers
  • Martha is a network monitoring technician working on a firewall for her company’s network. To filter traffic going through the f
    12·2 answers
  • I will give brainliest to the best answer. what is a good screen recorder
    11·1 answer
  • Your network uses a network address of 137. 65. 0. 0 with a subnet mask of 255. 255. 0. 0. How many ip addresses are available t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!