Because it, not only does it give you a chance to learn more about the workplace, it also makes you look more interested in the position.
<span />
Answer:
#include <iostream>
using namespace std;
int main() {
int k;
double d;
string s;
cin >> k >> d >> s;
cout << s << " " << d << " " << k << "\n" << k << " " << d << " " << s; }
Explanation:
k is int type variable that stores integer values.
d is double type variable that stores real number.
s is string type variable that stores word.
cin statement is used to take input from user. cin takes an integer, a real number and a word from user. The user first enters an integer value, then a real number and then a small word as input.
cout statement is used to display the output on the screen. cout displays the value of k, d and s which entered by user.
First the values of k, d and s are displayed in reverse order. This means the word is displayed first, then the real number and then the integer separated again by EXACTLY one space from each other. " " used to represent a single space.
Then next line \n is used to produce a new line.
So in the next line values of k, d and s are displayed in original order (the integer , the real, and the word), separated again by EXACTLY one space from each other.
The program along with the output is attached.
Answer:
See the program code below.
Explanation:
def cube_SA(edge):
edge = int(input("Enter the cube's edge: "))
sa = edge * edge * 6
print("The surface area is {} square units".format(sa))
cube_SA(4)
Best Regards!
Answer:
name = []
price = []
for i in range(0,8):
item_name = input('name of item')
item_price = input('price of item')
name.append(item_name)
price.append(item_price)
for i in range(0, 8):
print(name[i], '_____', price[i])
Explanation:
Python code
Using the snippet Given :
Apples 2.10
Hamburger 3.25
Milk 3.49
Sugar 1.99
Bread 1.76
Deli Turkey 7.99
Pickles 3.42
Butter 2.79
name = []
price = []
#name and price are two empty lists
for i in range(0,8):
#Allows users to enter 8 different item and price choices
item_name = input('name of item')
item_price = input('price of item')
#user inputs the various item names and prices
#appends each input to the empty list
name.append(item_name)
price.append(item_price)
for i in range(0, 8):
print(name[i], '_____', price[i])
# this prints the name and prices of each item from the list.