answer.
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
pogonyaev
2 years ago
4

Write a loop to print all elements in hourly_temperature. Separate elements with a -> surrounded by spaces. Sample output for

the given program with input: '90 92 94 95' 90 -> 92 -> 94 -> 95 Note: 95 is followed by a space, then a newline.
Computers and Technology
1 answer:
vekshin12 years ago
5 0

Answer:

The program to this question can be described as follows:

Program:

#include <iostream> //defining header file

using namespace std;

int main() //defining main method

{

int hourly_temperature[] ={90,92,94,95}; //defining integer array

int len= sizeof(hourly_temperature)/ sizeof(hourly_temperature[0]); //calculate length of array

for(int i=0;i<len-1;i++) //loop to print its value

{

   cout<<hourly_temperature[i]<<"->"; //print value

}

cout<<hourly_temperature[len-1]; //print last element value

return 0;

}

Output:

90->92->94->95

Explanation:

In the given code an integer array "hourly_temperature" is declared, which holds some value, that is "90,92,94,95", in the next step, an integer variable "len" variable is declared, that holds array size.

  • Then a for loop is declare that uses the "i" variable, which starts from 0 and ends when the "i" value is less than "len-1".
  • Inside the loop array values are printed with the "->" sign, and outside the loop, the last variable value is printed.  
You might be interested in
15. It is the process of capturing data or translating information to recording format
Helen [10]

Answer:

A Documentation, hope this helps.

5 0
2 years ago
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
mojhsa [17]

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.

6 0
2 years ago
__________ is the current federal information processing the standard that specifies a cryptographic algorithm used within the U
Free_Kalibri [48]

Answer:

FIPS 140-2 es el acrónimo de Federal Information Processing Standard (estándares federales de procesamiento de la información), publicación 140-2, es un estándar de seguridad de ordenadores del gobierno de los Estados Unidos para la acreditación de módulos criptográficos. ... El Instituto Nacional de Estándares y Tecnología (NIST)

Explanation:

8 0
2 years ago
PLEASE HELP!!~~
Law Incorporation [45]

Answer:

A

Explanation:

7 0
2 years ago
In the middle of the iteration, how should a team handle requirement changes from the customer? (1 correct answer)
Rina8888 [55]

The answer is 1 because it is

5 0
2 years ago
Read 2 more answers
Other questions:
  • The basic components of cartridges and shotshells are similar. Shot pellets and a bullet are examples of which basic component?
    13·1 answer
  • True or false words spelling and grammar check is always %100
    7·2 answers
  • Richard uses Microsoft outlook as his email client. He wants to check whether he has received any new mail. Identify which key R
    12·1 answer
  • Universal Containers recently rolled out a Lightning Knowledge implementation; however, users are finding unreliable and unrelat
    6·1 answer
  • Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
    14·1 answer
  • ________ is a free online service that enables a user to contact a cell phone number to hear who answers the telephone without i
    5·1 answer
  • Write a loop that outputs the numbers in a list named salaries. The outputs should be formatted in a column that is right-justif
    6·1 answer
  • #Write a function called fancy_find. fancy_find should have #two parameters: search_within and search_for. # #fancy_find should
    9·1 answer
  • Which XP practice prescribes that "the code [always be] written by two programmers at one machine"?.
    13·1 answer
  • Consider the following code segment, which is intended to create and initialize the two-dimensional (2D) integer array num so th
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!