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
sertanlavr [38]
3 years ago
11

Write a C++ program that will ask the user for the name of a data file.

Computers and Technology
1 answer:
rosijanka [135]3 years ago
4 0

Answer:

Explanation:

Enter information,

Enter name: Bill

Enter roll number: 4

Enter marks: 55.6

Displaying Information,

Name: Bill

Roll: 4

Marks: 55.6

THIS IS AN EXAMPLE I HOPE THIS HELPS YOU!!

You might be interested in
Write a program that will predict the size of a population of organisms. The program // should ask the user for the starting num
nordsb [41]

Answer:

Following are the program in the C++ Programming Language:

#include <iostream>

using namespace std;

int main() {

 float starting, average;

 int num;

 std::cout <<"Enter starting number of the organisms: ";

 while(!(std::cin >> starting)|| starting < 2){

   std::cout<<"starting number must be greater than 2\n";

   std::cout <<"Enter starting number of the organisms: ";

   std::cin.clear();

   std::cin.ignore(123,'\n');

 }

 std::cout <<"Enter the average of daily population is increase %: ";

 while(!(std::cin >> average)|| average < 0){

   std::cout<<"Average must be greater than 0\n Enter average";

   std::cin.clear();

   std::cin.ignore(123,'\n');

 }

   average *= .01;

 std::cout <<"Enter the number of days: ";

 while(!(std::cin >> num)|| num < 1){

   std::cout<<"Number of days no be less than 1\n" <<"Enterthe number of days\n";

   std::cin.clear();

   std::cin.ignore(123,'\n');

 }

 for(int i=0; i<num; i++){

   std::cout<<"population size of day"<<(i+1);

   std::cout<<": "<<starting<<std::endl;

   starting +=(starting*average);

 }

 return 0;

}

<u>Output</u>:

Enter starting number of the organisms: 4

Enter the average of daily population is increase %: 5

Enter the number of days: 4

population size of day1: 4

population size of day2: 4.2

population size of day3: 4.41

population size of day4: 4.6305

Explanation:

Here, we define header file "<iostream>" and namespace "std".

  • Then, we define the main() inside it, we set two float data type variable i.e., "starting", "average" and set an integer data type variable i.e., "num".
  • Then, we print a message and after that, we set the while loop for get input from the user in variable "starting" and pass the condition inside loop we print message than clear cin and ignore 123 then, we again do this to get  input from user in variable "average".
  • Then, we set the for loop and pass the condition inside the loop print the size of the day then print the value of "starting" after that we multiply.
  • Finally, we return 0 and close the main function.
7 0
3 years ago
How do I get more points?
9966 [12]

You can get more points by answering questions, and completing challanges.

I hope this helps!

-LizzyIsTheQueen


6 0
3 years ago
Read 2 more answers
1. Write a method to measure sortedness of an array. The method header is:
Licemer1 [7]
ㄴㄱㄷㅂㄷㅈ븟ㅈㅂㅈㅂㅈㄱㅅㄱㅈㅂㄷㅅㄷㅈㄱㅅㄱㅅㄴㅇㄴㅇㄴㅇㄴㅁㄴㅇㄴㅇㄴㅈㅂㅈㅂㅈㄱㅈㄴㅈㄴㄱㅆㅅㄱㅈㅂㄷㅅㅈㅂㅈㅅㄱ싲ㄱㅈㅂㄷㅂㅅㅇㄱㅇㄱㅅㅂㄷㅈㄱㅇㄱㅇㄱㄷㄱㅅㄱㅇㄱㄷㅈㄱㅇㅈㄱㅂㅈㅂㄷㅇㄷㅅㅆㄱㅇㄱㅅㅈㄱㅈㄱㅇㄱㅇㅂㅇㄱㅁㄱㅇㄱㅇㄱㅇㄱㅇㄱㅁㅋㅁㄱㅇㄱㅇㄱㅇㄱㄴㅁㄴㅇㄴㅇㄴㅇㄴㅇㄴㅇㄴㅇㄴㅇㄴㅁㄴㅇㄴㅇㄴㅅㄱㅈㄱㅈㅅ?...
7 0
3 years ago
Digital rights include the right to
faltersainse [42]
D. Speak your ideas with respect on the internet .
7 0
2 years ago
Which of the following is an example of new and emerging classes of software?
Rama09 [41]
The answer is Smart technology :)
4 0
3 years ago
Other questions:
  • In a video, a motionless image is called
    7·2 answers
  • True or false: when considering data backups, it is most important to verify that the integrity of the backup file or data is va
    9·1 answer
  • Do you like PC? Why? (I need your opinion for research)
    10·2 answers
  • . Business-to-business integration (B2Bi) is vital for efficient and accurate flow of data across internal ISs and external busi
    11·1 answer
  • Why is it so important to adhere to principles that have been put forth by reputable organizations to ensure that you are mainta
    10·1 answer
  • C++ Write a program that initially asks a user to enter two positive integer numbers a and b. If either a or are zero or negativ
    9·2 answers
  • List all the steps used to search for 25 in the sequence given below. Use both (a) linear search and (b) binary search. 2, 7, 13
    7·1 answer
  • There u go i did thereeeeeeeeeeeeeeeeeeeeeee
    13·2 answers
  • I am a non-volatile type of built-in memory. I store my contents long-term. My job is to store critical programs that the comput
    14·1 answer
  • 5 points)*list all of the data that needs to be kept track of for the scenario above in a 1nf (flat file) table (20 points)*use
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!