Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. In C++ Write short statements for each of the following: (Be to the point, you do not need to write the entire code). (4

image text in transcribed
2. In C++ Write short statements for each of the following: (Be to the point, you do not need to write the entire code). (4 x 5 = 20 points) a) Declare and initialize a variable (choose your own variable name) to store your favorite flower's name. b) Given an input file named: xydata.txt Write a suitable statement to open this file in C++. c) Given four variables (all floats) a, b, c, d Write a statement that will compute the average of the four variables and store in the variable average. d) Given the following mathematical expression for payment: PR payment = 1-(1 + R)-Y Where P, R, N are inputs, and assumed they are declared and their values are given. Write this formula in C++ suitably. e) Declare a string variable textbook to store the name of any text book. Then write an input statement to get the name of the text book (remember the text book name may not be one word long)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago