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
monitta
3 years ago
13

Write a program reverse-order.cpp which asks the user to input two dates (earlier date then later date). The program should repo

rt the West basin elevation for all days in the interval in the reverse chronological order (from the later date to the earlier).
Computers and Technology
1 answer:
xxMikexx [17]3 years ago
7 0

Answer:

reverse-order.cpp

#include<iostream>

#include <fstream>

#include <cstdlib>

#include <climits>

#include <sstream>

using namespace std;

#include <vector>

int main()

{

  ifstream fin("Current_Reservoir_Levels.tsv");

  if (fin.fail())

  {//check whether file exists or not

      cerr << "File cannot be opened for reading." << endl;

      exit(1);

  }

  //declare two vectors

  vector<string> Date;

  vector<float> westElVec;

  string header;

  getline(fin, header); // read one line from the file

  string dateArr[365], date;

  double eastSt, eastEl, westSt, westEl;

  string date1, date2;

  cout << "Enter starting date: ";

  cin >> date1; // getting starting date from user

 

  cout << "Enter ending date: ";

  cin >> date2; // getting ending date from user

  int count = 0;

  while (fin >> date >> eastSt >> eastEl >> westSt >> westEl)

  {

      fin.ignore(INT_MAX, '\n'); //skips to the end of line,

      //get the record from file

      //check if data is between the start and end or not

      if (date1 <= date && date2 >= date)

      {//insert the data

          Date.push_back(date);

          westElVec.push_back( westEl);

          count++;

      }

  }

 

  //sort the data by date indecending order

  for (int i = 0; i < count; ++i)

  {

      for (int j = 0; j < count - i - 1; ++j)

      {

          // Comparing consecutive dates

          if (Date[j] < Date[j + 1])

          {

              ////swap West basin elevation

              //double twestElVec = westElVec[j];

              //westElVec[j] = westElVec[j + 1];

              //westElVec[j + 1] = twestElVec;

              //swap dates

              string tDate = Date[j];

              Date[j] = Date[j + 1];

              Date[j + 1] = tDate;              

          }

      }

  }  

  for (int i = 0; i < count; i++)

      cout << Date[i] << "\t" << westElVec[i] <<"ft"<< endl;

  fin.close();

  //system("pause");

return 0;

}

Explanation:

You might be interested in
PLEASE HELP
Rainbow [258]

Explanation:

examples

Area= Side Squared

area =square root of 49cm Squared =Square root of S Squared

A=7cm Squared

6 0
2 years ago
Source view shows your website_____ A) exactly as it would appear when published B) approximately as it would appear when publis
Georgia [21]
In html code so the answer is d
7 0
3 years ago
Read 2 more answers
Computer simulations were first developed during __________<br> as a part of the _____________
Effectus [21]

Answer:

WWII; Manhattan Project.

Explanation:

Computer simulation refers to a mathematical model designed and developed to predict the outcome or behavior of a hypothetical or real-life scenario on a computer system, so as to illustrate and understand how the system functions.

Historically, computer simulations were first developed during World War II (WWII) as a part of the Manhattan Project.

For example, SimpleScalar refers to a computer architectural simulating software application or program which was designed and developed by Todd Austin at the University of Wisconsin, Madison, United States of America. It is an open source simulator written with "C" programming language and it's used typically for modelling virtual computer systems having a central processing unit (CPU), memory system parameters (hierarchy), and cache.

6 0
3 years ago
Malcolm is part of a team developing a new smartphone app to track traffic patterns. Because team members are located throughout
Umnica [9.8K]

Answer:

Virtual team

Explanation:

A virtual team is also known as a remote team, where every member of the team is working from different geographic locations. Usually, the communication channel is through voice/video conferencing or email.

Each member of the team is given unique roles and these roles are delivered optimally within the specified time frame.

For instance, Malcolm does not meet with other members of the team, yet they are working on a project (a smartphone app to track traffic patterns). Following standards that would have applied if they were working at a specific location.

Thanks to Information and Communication Technology (ICT), virtual jobs are on the increase, providing jobs to a lot of people not minding their geographic location.

7 0
3 years ago
If a wire has insulation that allows it to operate in a temperature of up to 194 degrees Fahrenheit, what temperature will the w
zzz [600]
(194°F-32)×5/9
= 90°C
therefore the answer is 90degrees Celcius
6 0
4 years ago
Other questions:
  • Implement the function calcWordFrequencies() that uses a single prompt to read a list of words (separated by spaces). Then, the
    8·1 answer
  • Create a cell array, called A, with the following contents: a. Make a copy of A called B. (Nothing complicated: B = A is suffici
    10·1 answer
  • _____ are special combinations of keys that tell a computer to perform a command.
    9·2 answers
  • In order to use an object in a program, its class must be defined.
    9·1 answer
  • Any one of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer pr
    15·1 answer
  • Which approach to knowledge management capitalizes on tacit knowledge and requires heavy IT investment?
    7·1 answer
  • You are the head of the corporate security department, and the Microsoft teamhas asked you for some assistance in setting the pa
    11·1 answer
  • What type of version of visual studio is the visual studio express
    8·1 answer
  • Ten examples of an interpreter
    8·1 answer
  • When you open a program, the hard drive
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!