Questions
C++ Question 2 You will read in data about the planets from a text file, and...

C++ Question 2

You will read in data about the planets from a text file, and then print out the data about that planet when the user requests the data. You will need to create a Planet Class (since this assignment does not cover templates, you are expected to split your class into .cpp and .h files), as well as a .cpp/.h library with the functions described below

Planet Class

For the first phase of the question, you will create a Planet class.

Include the iostream and fstream libraries in the Planet class so we can do the friend operator<<

Before the class definition, create a const integer that defines the number of planets as 9. (Yes, I am counting Pluto for the purposes of this assignment.)

The Planet class should have the following private members:
*
* A std::string with the planet's name
* A double that is the mean distance from the sun
* A double that is the circulation time around the sun
* A double that is the rotation time around own its own axis
* A long unsigned int that is the planet's equatorial radius in kilometers ;
* A double that is the planet's mass compared to earth ;
* An unsigned int that is the planet's number of moons ;

You will need to create a constructor that takes in all these values and stores them using a member initialization list.
* Remember that your member initialization list must be in the same order as the private members are listed in the class definition. Recall the reason why: we want to ensure effective pointer arithmetic when allocating these elements, so putting them in order will make your program run more efficiently.
Next, you should write a method that returns the Planet's Name.

Next, you should write an overloaded friend operator that prints out the information regarding the Planet. You may reference the format below to see a good output format. Here are a couple of crucial details to make it work:
* You will need to multiply the mean distance from the sun by 149500000 to get the number of kilometers
* Remember my "rules" for creating a friend operator<< in .h and .cpp
* Remember the importance of const and call by reference in the overloaded operator.

Function Library

For the second phase of the assignment, you will create functions to call the Planet objects, and these functions will be called in main

First, be sure to include the Planet.h library for the class

Second, include string and vector libraries in this .h file

You will need to write two functions in the .h/.cpp files

void getPlanets( std::ifstream& ifs, std::vector< Planet >& thePlanets );
In main, you will create an ifstream and a vector of Planets. In this file, you will read in from the file information about the Planets. The information is stored in the exact order that we made in the class.

The data may be found here at PlanetData.txt:

Mercury 0.387 0.241 58.815 2433 0.05 0
Venus 0.723 0.615 224.588 6053 0.82 0
Earth 1.000 1.000 1.000 6379 1.00 1
Mars 1.523 1.881 1.029 3386 0.11 2
Jupiter 5.203 11.861 0.411 71370 317.93 12
Saturn 9.541 29.457 0.428 60369 95.07 10
Uranus 19.190 84.001 0.450 24045 14.52 5
Neptune 30.086 164.784 0.657 22716 17.18 2
Pluto 39.507 248.35 6.410 5700 0.18


Use the while( ifs.good() ) to loop through the file. In each loop, create a temporary variable for each element, and then read in using the ifs >> operator. Once read in, create a temporary Planet using the constructor you wrote. Then, push that temporary Planet onto the vector.

bool getPlanetNameFromUser( std::string& planetName );

Prompt the user to enter a value from the command line, or "End" to terminate. If the user entered end, call exit(-1) to end the program. Otherwise, return true. planetName will store the value. Calling planetName by reference will save the input.


Main Program

For the third phase of the question, you will develop the program itself. In the main program:
* create a std::vector of Planets and an std::ifstream. (You may hardcode the Planet file into this program instead of reading from the command line)
* Then get the Planets from the file.
* Create a string to store the user's response
* Using a while loop, Get the Planet Name From the User and use the bool to determine whether to continue
* When we go inside the loop
* Create a long unsigned int to loop
* Iterate through the vector, and compare the Planet's name in each Planet in the vector
* For this internal while loop, it is important to check if the long unsigned int is less than the number of planets, and then check to see if the Planet's name is equal to the input
* Otherwise, you will get major issues with segmentation faults
* After the while loop completes, make an if statement
* First, check if the iteration value is less than the number of planets (for the same reason)
* Next, check if the name at the Planet at the iter location is equal to the string input by the user
* If both tests pass, use the Planet's operator<< to print the information to the user.

In: Computer Science

Required information Problem 14-23 Preparing a master budget for retail company with no beginning account balances...

Required information

Problem 14-23 Preparing a master budget for retail company with no beginning account balances LO 14-2, 14-3, 14-4, 14-5, 14-6

[The following information applies to the questions displayed below.]

Finch Company is a retail company that specializes in selling outdoor camping equipment. The company is considering opening a new store on October 1, 2019. The company president formed a planning committee to prepare a master budget for the first three months of operation. As budget coordinator, you have been assigned the following tasks:

Problem 14-23 Part 1

Required

  1. October sales are estimated to be $340,000, of which 35 percent will be cash and 65 percent will be credit. The company expects sales to increase at the rate of 20 percent per month. Prepare a sales budget.

  2. The company expects to collect 100 percent of the accounts receivable generated by credit sales in the month following the sale. Prepare a schedule of cash receipts.

  3. The cost of goods sold is 70 percent of sales. The company desires to maintain a minimum ending inventory equal to 20 percent of the next month’s cost of goods sold. However, ending inventory of December is expected to be $12,500. Assume that all purchases are made on account. Prepare an inventory purchases budget.

  4. The company pays 60 percent of accounts payable in the month of purchase and the remaining 40 percent in the following month. Prepare a cash payments budget for inventory purchases.

  5. Budgeted selling and administrative expenses per month follow:

Salary expense (fixed) $ 18,500
Sales commissions 4 % of Sales
Supplies expense 2 % of Sales
Utilities (fixed) $ 1,900
Depreciation on store fixtures (fixed)* $ 4,500
Rent (fixed) $ 5,300
Miscellaneous (fixed) $ 1,700
  1. *The capital expenditures budget indicates that Finch will spend $133,000 on October 1 for store fixtures, which are expected to have a $25,000 salvage value and a two-year (24-month) useful life.

Use this information to prepare a selling and administrative expenses budget.

  1. Utilities and sales commissions are paid the month after they are incurred; all other expenses are paid in the month in which they are incurred. Prepare a cash payments budget for selling and administrative expenses.

  2. Finch borrows funds, in increments of $1,000, and repays them on the last day of the month. Repayments may be made in any amount available. The company also pays its vendors on the last day of the month. It pays interest of 2 percent per month in cash on the last day of the month. To be prudent, the company desires to maintain a $17,000 cash cushion. Prepare a cash budget.

  3. Prepare a pro forma income statement for the quarter.

  4. Prepare a pro forma balance sheet at the end of the quarter.

  5. Prepare a pro forma statement of cash flows for the quarter.

In: Accounting

Problem 25.57 On your first day at work as an electrical technician, you are asked to...

Problem 25.57

On your first day at work as an electrical technician, you are asked to determine the resistance per meter of a long piece of wire. The company you work for is poorly equipped. You find a battery, a voltmeter, and an ammeter, but no meter for directly measuring resistance (an ohmmeter). You put the leads from the voltmeter across the terminals of the battery, and the meter reads 12.0 V . You cut off a 20.0-m length of wire and connect it to the battery, with an ammeter in series with it to measure the current in the wire. The ammeter reads 7.00 A . You then cut off a 40.0-m length of wire and connect it to the battery, again with the ammeter in series to measure the current. The ammeter reads 4.50 A . Even though the equipment you have available to you is limited, your boss assures you of its high quality: The ammeter has very small resistance, and the voltmeter has very large resistance.

What is the resistance of 1 meter of wire?in ohm

In: Physics

What did you learn about this structure that was a surprise to you or resonated with...

What did you learn about this structure that was a surprise to you or resonated with you about building relationships in the workplace? Did the people who built this wall have to work together? Are there any lessons to be learned about building relationships across philosophical divides (differing world views) in the workplace?

Note: Please avoid comments or references to the southern border between Mexico and the USA. This is a highly controversial subject and your comments may be taken out of context and appear as harassment. Any comments about the southern border or Mexico will be immediately removed and points deducted from your score

In: Psychology

Need understanding for the concept to the question below. Write 2 paragraphs on an advertisements that...

Need understanding for the concept to the question below.

Write 2 paragraphs on an advertisements that illustrate the needs for power and discuss their effectiveness.

In: Operations Management

Need understanding understanding the concept to the question below. Write 2 paragraphs on an advertisements that...

Need understanding understanding the concept to the question below.

Write 2 paragraphs on an advertisements that illustrate the needs for achievement and discuss their effectiveness.

In: Operations Management

What is enhanced ER Model? Explain extended ER features: Specialization, Generalization and Aggregation with your clear...

What is enhanced ER Model? Explain extended ER features: Specialization, Generalization and Aggregation with your clear definitions/ideas/differences in your own words and give at least one appropriate example for each one of them.

In: Computer Science

Summit Credit Union, located in Madison and Milwaukee, Wisconsin, is a small company with 366 employees....

Summit Credit Union, located in Madison and Milwaukee, Wisconsin, is a small company with 366 employees. A merger in 2015 doubled the size of the company and made it necessary to build a new corporate culture. Summit’s mission is to improve credit members’ financial lives to help them achieve their dreams. For example, in 2013 Summit members saved over $13 million based on higher savings rates, lower loan rates, and lowerfees compared to for-profit banking institutions in Wisconsin. Summit has invested in creating a world-class learning function, which includes a team of seven professionals who are able to design and deliver instructor-led training as well as e-learning. Summit has shifted away from generic off-the-shelf training to develop online and face-to-face programs customized to employee needs and the company’s goals and initiatives. For example, the learning function is expected to play a key role in dealing with business issues such as efficiency, loan growth, and increased sales. All learning staff members are expected to contribute to new company initiatives, such as new products and services, systems, or regulations. Summit has recently identified a problem with its new lenders. They were starting to perform their jobs without the necessary skills, information, and knowledge that they needed. One potential reason for this is how the lending training curriculum is organized. New lenders attend a course on different types of loans and the lending system, start their jobs, and then later return for a course on lending guidelines, underwriting, and sales skills. Analysis: Analyze your training objectives using SMART training goals. Provide your analysis of your objectives, your brainstorming of the connections to future pieces of training (where applicable), and create your training goals

In: Operations Management

To test whether the enactment of seatbelt legislation had any association with injuries to vehicle users,...

To test whether the enactment of seatbelt legislation had any association with injuries to vehicle users, a random sample of 7676 individuals taken over a two-year period (one year prior legislation and one year post legislation) was used. The results are detailed below.

Post Legislation

Prior Legislation

Total

No Injury

1320

5430

6750

Minimal Injury

70

552

622

Major Injury

32

224

256

Fatal Injury

10

38

48

Total

1432

6244

7676

Please write a summary statement for this hypothesis test.

In: Math

The proliferation of social media has made it easier for companies to reach out to their...

The proliferation of social media has made it easier for companies to reach out to their customers. Companies, especially new start-ups, may not afford to dive into every social media channel. They, instead, choose several platforms and focus exclusively on delivering quality content to target customers. Thus, they need to ask themselves: what social media platforms should they choose, and what factors should they consider when determining the most suitable platforms? What is your opinion? 2 paragraphs

In: Operations Management

, design the information security of an organization

, design the information security of an organization

In: Computer Science

Need the basic understanding of the question below. Write 2 paragraphs about an advertisements that  illustrate the...

Need the basic understanding of the question below.

Write 2 paragraphs about an advertisements that  illustrate the needs for affiliation?

In: Operations Management

The world has been struggling to contain the spread of the Covid-19 pandemic using measuring such...

The world has been struggling to contain the spread of the Covid-19 pandemic using measuring such as lockdowns and travel restrictions. These measures have created economic pain all across the world. To help ease the economic impact, governments and monetary authorities have mooted stimulus packages. Bank of South Africa, in particular, has taken a number of measures to support economic activity and avoid a collapse of the economy. Among these measures include: a decision to keep monetary policy unchanged despite rising inflation; $1 billion stimulus package for strategic sectors; promise to provide more liquidity to the money market. As a student of monetary policy, discuss the expected economic implications of these measures citing practical examples.

In: Economics

Pick immjgration, equality or abortion as a social issue you feel strongly about - Write a...

Pick immjgration, equality or abortion as a social issue you feel strongly about - Write a word letter to an elected official.​ The letter should a) describe your personal views on the issue and how you developed those views; b) identify at least three (3) related U.S. Supreme Court cases that relate to your topic and summarize the main points of these cases, and c) explain whether you think the Court decided these cases correctly, or not. ​Be absolutely sure to include specific quotes from opinions and dissents from at least four separate cases and explain their relationship with each other.​ Lastly, in the conclusion of your letter, be sure to make a recommendation - tell the elected official what you would like them to do and what changes you would like them to make. You should remind them of some of the specific points you raised in your analysis of the cases.
Guidelines for all papers

In: Operations Management

In OB theory and other than "legitimate" power name and briefly describe 4 other bases of...

In OB theory and other than "legitimate" power name and briefly describe 4 other bases of individual power in an organization?

In: Operations Management