In this lab, you open a file and read input from that file in a prewritten C program. The program should read and print the names of flowers and whether they are grown in shade or sun. The data is stored in the input file named flowers.dat. Instructions Ensure the source code file named Flowers.cpp is open in the code editor. Declare the variables you will need. Write the C statements that will open the input file flowers.dat for reading. Write a while loop to read the input until EOF is reached. In the body of the loop, print the name of each flower and where it can be grown (sun or shade). Execute the program by clicking the Run button at the bottom of the screen.

Answers

Answer 1

Answer:

#include <stdio.h>

#include <string.h>

void main( )

{

array flowerProp[2];

FILE *fp; // file pointer

char flower[255]; // creating a char array to store data

fp = fopen("flowers.dat","r");

if (fp == NULL){

   printf("File flower.dat does not exist");

   return;

}

// assuming the growing condition is next line to the flower name.

while(fscanf(fp, "%s", flower)!=EOF){

   flowerProp.push(flower);

   if (flowerProp.length == 2){

       printf("%s: %s\n ", flowerProp[0], flowerProp[1]);

       memset(flowerProp, 0,0);

   }

}    

fclose (fp );

}

Explanation:

The algorithm creates a pointer to the memory location to the file starting position, the character size is used to get a string from the file line by line. Then it opens and checks if the file exists.

If the file exists, the while gets the name and growth condition of the flower, saves it to an array, prints the name and condition, and clears the array for the next flower type in the loop.


Related Questions

Comments should Your answer: rephrase the code it explains in English be insightful and explain what the instruction's intention is only be included in code that is difficult to understand be used to define variables whose names are not easy to understand

Answers

Answer:

(b) be insightful and explain what the instruction's intention is.

Explanation:

Required

Which describes a comment in options (a) to (d)

Comments are not meant to replace the original code but to explain what the code is meant to do; so that even if the code gets to a non-programmer, the person will understand what the code is all about.

From (a) to (d), only option (b) fits the above description.

How to use the RANK Function in Microsoft Excel

Answers

Answer:

=RANK (number, ref, [order])

See Explanation

Explanation:

Literally, the rank function is used to rank values (i.e. cells) in a particular order (either ascending or descending).

Take the following instances:

A column used for total sales can use rank function to rank its cells from top sales to least.

A cell used for time can also use the rank function to rank its cells from the fastest time to slowest.

The syntax of the rank function is:

=RANK (number, ref, [order])

Which means:

[tex]number \to[/tex] The rank number

[tex]ref \to[/tex] The range of cells to rank

[tex]order \to[/tex] The order of ranking i.e. ascending or descending. This is optional.

Given positive integer n, write a for loop that outputs the even numbers from n down to 0. If n is odd, start with the next lower even number.

Answers

Answer:

if(n % 2 == 0){

   for(int i = n; i >= 0; i-=2){

        System.out.println(i);

    }

}

else{

     for(int i = n - 1; i >= 0; i-=2){

        System.out.println(i);

     }

}

Sample output

Output when n = 12

12

10

8

6

4

2

0

Output when n = 21

20

18

16

14

12

10

8

6

4

2

0

Explanation:

The above code is written in Java.

The if block checks if n is even by finding the modulus/remainder of n with 2.  If the remainder is 0, then n is even. If n is even, then the for loop starts at i = n. At each cycle of the loop, the value of i is reduced by 2 and the value is outputted to the console.

If n is odd, then the else block is executed. In this case, the for loop starts at i = n - 1 which is the next lower even number. At each cycle of the loop, the value of i is reduced by 2 and the value is outputted to the console.

Sample outputs for given values of n have been provided above.

Please answer it’s timed

Answers

Answer:

1st one

Explanation:

or the last, im a bit positive its the first one though

Popular periodicals might include newspapers

True or false?

Answers

Answer:

False

Explanation:

Because there is no way that would be correct!

Answer:

True

Explanation:

It makes sense

~Plz tap the crown ~

~Thank you~

If I were to delete a file on a school Chromebook on Chrome OS, would teachers have some special way of seeing it?

Answers

Answer:

Depends on the teacher. Some of my teachers were able to save my deleted files.  

Explanation:

Depends on what teacher and what file I’ve had friends that delete files and the teacher was able to view it

If you were practicing keyboarding and the exercise contained the letters j, k, l, m, n, and b, what section of the
keyboard are you practicing?
upper, home row, Right, or Left

Answers

The answer is left.

Answer:

it's the right.

Explanation:

It is not possible for an array to hold an array.
True or false

Answers

Answer:

False

Explanation:

i just tested it

What is a good practice to remember when adding transitions to a presentation?
O Use one type of transition throughout.
O Add the same sound to the transitions.
O Use different effects between the slides.
O Add different colors to the upcoming slide.

Answers

Answer:

A. Use one type of transition throughout.

Explanation:

Edge 2021.

Answer:

It's A - Use one type of transition throughout.

On edge 2021

Explanation:

pleaseeeeeeee tellllllllllllllllllllll​

Answers

Answer:

hey

Explanation:

I hope is helpful

Mark mi brilliant plzz

(FORMAL FEEDBACK )IS YOUR ANSWER

Choose the item which best describes the free frame list. 1. a per process data structure of available physical memory 2. a global data structure of available logical memory 3. a global data structure of available physical memory 4. a global data structure of available secondary disk space

Answers

Answer:

A global data structure of available logical memory ( Option 2 )

Explanation:

A Free list is a data structure connecting unallotted regions in a memory together in a linked list (scheme for dynamic/logical memory allocation) , hence a free frame list is a global data structure of available Logical memory .

I need help with this question!!

Answers

Answer:

True

Explanation:

it just to make sense

Which is more important—book smarts or street smarts? Why? Which do you have more of?

Answers

Answer: book smart beacause book smart is intelligent and smart and learned the right thinks other than street smart people are unitelligent and incapable of achieving a higher education, but are more passionate and can usually find an answer to a problem through trial and error. We mostly have both cuz we learn in different ways

Explanation:

i hope this helps

brainliest??

Answer: book smart beacause book smart is intelligent and smart and learned the right thinks other than street smart people are unitelligent and incapable of achieving a higher education, but are more passionate and can usually find an answer to a problem through trial and error. We mostly have both cuz we learn in different ways


Landing pages in a foreign language should never be rated fully meets?

Answers

Answer:

if the landing page provides all kind information of information as to that site people usually like it or will most likely enjoy it

BRAINLIEST?????

Explanation:

A sorted list of numbers contains 500 elements. Which of the following is closest to the maximum number of list elements that will be examined when performing a binary search for a value in the list?
A.) 10

B.) 50

C.) 250

D.) 500

Answers

The answer is B.

hope its correct

Following are the calculation to the maximum number of list elements:

The binary search algorithm starts in the center of the sorted list and continuously removes half of the elements until the target data is known or all of the items are removed. A list of 500 elements would be chopped in half up to 9 times (with a total of 10 elements examined).The particular prerequisites with 500 items and are decreased to 250 elements, then 125 aspects, then 62 elements, 31 aspects, 15 aspects, 7 aspects, 3 aspects, and ultimately 1 element.

Therefore, the final answer is "Option A"

Learn more about the binary search:

brainly.com/question/20712586

pleaseeeeeeee tellllllllllllllllllllll​

Answers

Answer:

visual communication

hope it helps

stay safe healthy and happy.

Answer:

visual communication will be the correct answer

Compare and contrast data warehouse and big data storage environments. Discuss the purpose, the data, the need for more than one BI data environment, whether these environments are complementary or competitive, and processing tools and methods used in the environments. Also include other items as you see fit. (15 points)

Answers

Answer:

The responses to the given question can be defined as follows:

Explanation:

The database engine is a large data store gathered from a wide range of sources within about an undertaking or Old to inform management decisions.

We study the database system and big data reasonably Information storage of Big Data is applied to the difficulty of storing data.

Big Data is a new term used to identify datasets due to the size and complexity. A database server is a given database category.

They are used to store huge quantities of data, such as analysis, historic or consumer data, but instead produce large reports and mines.

In the database system, the complexity of unstructured data is sung easily.

The challenge of big data is one of the most exciting opportunities for those decades to come.

A database server is a centralized relation server, where all the attractive data from different systems is gathered together.

They must wash and structure your data at the position of insertion before placing them inside a warehouse. This process is usually alluded to as ETL Extract, Transform, and Load.

The solution to the database system is helpful as the next step is clean and quick Big data and the data warehouse could only be a strong team to gain a strong range of new application scenarios.

However, they have to find a couple of changes to existing infrastructure, tools, and processes and incorporate large amounts of data into your existing world.

Its university and IT industry paid too much attention to Big Data.

Digital data is created or stored inside the computer world at a pace that exceeds the boundary range rapidly.

Upwards of two billion people were connected to the Internet globally. And more than five billion people own mobile telephones.

By 2020, the Internet typically connects 50 milliards of computers.

It will then be 44 times the predicted data output in 2009.

The information is transferred to the optical fiber and shared at supersonic speeds.

The amount of data, as well as the pace of the industry growth, increases because the information is transferred or exchanged at light speed on optical fiber and network devices.

Which of the following describes a characteristic of organic light-emitting diodes (OLEDs) used in clothing?

uniform

flexible

transparent

sizeable

Answers

Flexible

Hopes this helps!

Answer:

Yes the answer is flexible.

Explanation:

I took the test and got it right.

Type the correct answer in the box. Spell all words correctly.
In a content file, Rick wants to add information that gives directions about how the content will be used. He also wants it to be easily differentiable from the content. Which language should Rick use for this?
Rick can use the _____
language to give directions about the content.

Answers

Answer: markup

Explanation:

Markup is used to give directions about the arrangement of an image/text.

Answer:

Rick can use the markup language to give directions about the content.

Explanation:

I got it right on the test for Edmentum.

njvekbhjbehjrbgvkheb

Answers

Answer:

shvajskzhzjsbssjjsusisj

A digital forensic analyst examines the original digital source (e.g. computer, flash drive, backup tape) suspected of being involved in a cyber crime just as the traditional forensic analyst examines the original gun or knife suspected of being used in a murder investigation. True False

Answers

Answer: True

Explanation:

Digital forensic analysts are the people who examine digital devices such as cameras, mobile phones and computers in order to get evidence of crime.

The evidence gotten by them can then be used to provide support to criminal investigations and can also be given to the intelligence agencies. Their function is to get back and safeguard the digital data which are related to cybercrime investigations as well as criminal investigations.

Complete the sentences about interactive media.
With (cipher text, hypertext, teletext,) text is the main element of the content. (hypermedia, hypervideo, dynamic media) on the other hand, includes text as well as audio, video, and animation.

Answers

Answer:

teletext

dynamic media

Explanation:

Answer:

1, teletext
2, dynamic media

Explanation:

Trade Periodicals are usually highly scholarly resources
True

False

Answers

Answer:

False

Explanation:

Trade publications may be written by experts in a certain industry, but they are not considered scholarly, as they share general news, trends, and opinions, rather than advanced research, and are not peer-reviewed.

Write functions to compute a subset, find member, union, and intersection of sets. Follow the steps below:

1. Read two integers from the user.
2. Suppose one of the integers is 2311062158. The binary equivalent of this integer stored in a register will be 1000 1001 1100 0000 0000 0010 1000 1110. This data should be regarded as bit strings representing subsets of the set {1, 2, … 32}. If the bit string has a 1 in position i, then element i is included in the subset. Therefore, the string: 1000 1001 1100 0000 0000 0010 1000 1110 corresponds to the set: {2, 3, 4, 8, 10, 23, 24, 25, 28, 32}.
3. Print out members of the set from smaller to larger. You can do a loop from 1 to 32. Load a masking bit pattern that corresponded to the position number of the loop counter (0x00000001 for 1). Isolate the bit in the operand by using the AND operation. If the result of the AND is not 0 then the loop counter is in the set and should be displayed. Increment the counter and shift the masking bit pattern to the left.
4. Read a number from the user. Determine if that element is a member of the given sets.
5. Determine the union of two sets.
6. Determine the intersection of two sets.
7. Implement a loop back to the main function. See the prompts below: "Enter the first number:" "Enter the second number:" "Members of Set 1:" "Members of Set 2:" "Enter an element to find:" "It is a member/ not a member of set 1" "It is a member/ not a member of set 2" "Union of the sets:" "Intersection of the sets:" "Do you want to compute set functions again?"
8. Test the program using the following data:

Enter the first number: 99999
Enter the second number: 111445
Members of set 1: 1 2 3 4 5 8 10 11 16 17
Members of set 2: 1 3 5 7 9 10 13 14 16 17
Enter an element to find: 7
It is not a member of set 1
It is a member of set 2
Union of the sets: 1 2 3 4 5 7 8 9 10 11 13 14 16 17
Intersection of the sets: 1 3 5 10 16 17

Answers

Explanation:

Suppose one of the integers is 2311062158. The binary equivalent of this integer stored in a register will be 1000 1001 1100 0000 0000 0010 1000 1110. This data should be regarded as bit strings representing subsets of the set {1, 2, … 32}. If the bit string has a 1 in position i, then element i is included in the subset. Therefore, the string: 1000 1001 1100 0000 0000 0010 1000 1110 corresponds to the set: {2, 3, 4, 8, 10, 23, 24, 25, 28, 32}.

Question #7 Dropdown Choose the term to make the sentence true. A search will________ determine the index of the goal.
a. always
b. never
c. sometimes​

Answers

A search will sometimes determine the index of the goal.

hope it will help

Your answer is C. Sometimes

PLZ ANSWER WORTH 20 POINTS!! URGENT!

To use Office 365 and
OneDrive, you need ____.

A. to pay for online storage space

B. the latest version of Microsoft Office on your device

C. a registered Microsoft account

D. be logged on a school computer
Spring 2021 Post TLC CA

Answers

Answer:

C. a registered Microsoft Account

Answer:

B:the latest version of Microsoft Office on your device

Explanation:

I got it from the internet.

Write a program second.cpp that takes in a sequence of integers, and prints the second largest number and the second smallest number. Note that in the case of repeated numbers, we really mean the second largest and smallest out of the distinct numbers (as seen in the examples below). You may only use the headers: and . Please have the output formatted exactly like the following examples: (the red is user input)

Answers

Answer:

The program in C++ is as follows:

#include <iostream>

#include <vector>

using namespace std;

int main(){

   int n;

   cout<<"Elements: ";

   cin>>n;

   vector <int>num;

   int input;

   for (int i = 1; i <= n; i++){        cin>>input;        num.push_back(input);    }

   int large, seclarge;

   large = num.at(0);      seclarge = num.at(1);

  if(num.at(0)<num.at(1)){     large = num.at(1);  seclarge = num.at(0);   }

  for (int i = 2; i< n ; i ++) {

     if (num.at(i) > large) {

        seclarge = large;;

        large = num.at(i);

     }

     else if (num.at(i) > seclarge && num.at(i) != large) {

        seclarge = num.at(i);

     }

  }

  cout<<"Second Largest: "<<seclarge<<endl;

  int small, secsmall;

  small = num.at(1);       secsmall = num.at(0);

  if(num.at(0)<num.at(1)){ small = num.at(0);  secsmall = num.at(1);   }

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

     if(small>num.at(i)) {  

        secsmall = small;

        small = num.at(i);

     }

     else if(num.at(i) < secsmall){

        secsmall = num.at(i);

     }

  }

  cout<<"Second Smallest: "<<secsmall;

  return 0;

}

Explanation:

See attachment for explanation

provide five signs of cyber bullying​

Answers

Answer:

DECREASE in device usuage

sudden withdraw from social media

Relutance for activations

Emotional changes

unwillingness to communicate

Signs of cyber bullying will be Persistent Negative Messages, harassment, Social Exclusion or Shaming, etc.

Constantly Sending Victim Derogatory Messages: Cyberbullying frequently entails the victim receiving offensive, threatening, or threatening messages.

Online harassment is a form of cyberbullying in which the victim is relentlessly pursued with malign intent.

Cyberbullies may purposefully exclude the victim from online organisations, communities, or social circles while also subjecting them to social exclusion or shame.

As to intimidate, humiliate, or deceive the usual victim, cyberbullies will occasionally create bogus accounts or impersonate others online.

Changes in Emotion or Behaviour: As a incidence of the harassment, victims of cyberbullying may experience changes in their emotions or actions.

Thus, it is critical to take help from reliable people, report instances, and take precautions to protect the online safety if someone you know is a victim of cyberbullying.

For more details regarding cyberbullying, visit:

https://brainly.com/question/17703984

#SPJ5

In Python what are the values passed into functions as input called?

Answers

formal parameter or actual parameter i think

Which is NOT a component of a 3-point lighting system?

Answers

Answer:

Explanation:

Three-point lighting is a traditional method for illuminating a subject in a scene with light sources from three distinct positions. The three types of lights are key light, fill light, and backlight.

Key light. This is the primary and brightest light source in the three-point lighting setup. It gives a scene its overall exposure. Cinematographers typically position this main light slightly off to the side of the camera and the front of the subject, on a light stand at a 45-degree angle to the camera, which creates shadows on the opposite side of the subject’s face, giving it dimension and depth. The primary light creates the mood of a scene. Depending upon its position and the supplemental lights used in the overall lighting, it can create a high-key image (evenly, softly lit and atmospherically upbeat) or a low-key image (high contrasts, deep shadows, and very moody).

Fill light: Mirroring the key light on the opposite side of the camera, the fill light literally fills in the shadows that the key light creates on a subject, bringing out details in the darkness. Typically, this secondary light is less bright than the key, and cinematographers control the overall feel of their shots based on how much they dim or lighten the fill light. A dim fill light, where the fill ration is high, creates a high-contrast, film-noir type of shadow, while a brighter light with a lower, more balanced ratio gives the subject a more even look. The second light isn’t always a light: it can be a reflector, a bounce card, a wall, or anything that bounces back some light onto the subject to fill in the shadows. Together with the key light, the fill light determines the mood of a scene.

Backlight: The third source in this lighting technique, the backlight (also known as the “rim light” or “hair light”) shines on a subject from behind, completing the light setup. This creates a rim of light or outline around their head that pushes the subject away from the background and gives a sense of depth. Typically, cinematographers position the backlight directly behind the subject or high enough to be out of frame, opposite the key light, and pointing at the back of the subject’s neck.

Other Questions
Determine the scale factor for A ABC to A A'B'C:A. 1/2B. 10C. 5D. 2 The Park protectors is a group of elementary students and teachers from 30 to school to pick up trash at local parks. Line plot shows a tons of trash they picked up this year There are 32 scores in a group how much trash did the school pick up this year? A backpack that normally sells for $39 is on sale for 30% off. Find the amount of the sale price. There is a bin of markers.For every 2 red markers, there are5 purple markers. Use the table torepresent the ratio of purplemarkers to red markers. Maggie is buying a jacket. The expression shown represents the sales tax on the jacket price, j.0.08j Write an expression in terms of j to represent the total amount that Maggie spends on the jacket, including tax. You deposit $5,000 in an account that pays 2% annual interest. How longdoes it take the balance to reach $10,000 when the interest iscompounded continuously. Round to the nearest tenth of a year. Bramble sells softball equipment. On November 14, they shipped $4300 worth of softball uniforms to Novak Middle School, terms 3/10, n/30. On November 21, they received an order from Douglas High School for $2500 worth of custom printed bats to be produced in December. On November 30, Novak Middle School returned $450 of defective merchandise. Bramble has received no payments from either school as of month end. What amount will be recognized as accounts receivable, net on the balance sheet as of November 30 if f(x)=x^{2}+2x+4 what is f(3) Which expresion shows the phrase "497 decreased by 87"? A. 497 + 87 B. 497 87 C. 497 87 D. 497 87 plz help asap.. I have no clue how to do this. No links please Lines L and M are parallel find the measure of angle 7 find the area of the trapezoid? and no links Which lines from the poem clarify the theme of "Love is more important than wealth""Though I am old with wandering" (line 18)"I will find out where she has gone." (line 20)"And pluck till time and times are done" (line 22)"Because a fire was in my head," (line 2)"But something rustled on the floor" (line 11) for item 5 and 6 , select the word that matches the words in the group. ( bark , scream , purr ) a.laught b.read c.leap d.shout Could a volcano pop up in Omaha? Please help! I will give Brainliest! Donna and Dave were participating in a lab on the properties of water. First, they tried to see how many drops of water they could fit on a penny. Then they dropped water and alcohol on waxed paper and observed what happened. Next they made a streak of water and then alcohol on the lab bench. The alcohol streak dried up and disappeared first. Donna and Dave had to write an explanation for everything that happened during the lab. How can they explain the disappearing alcohol? A) Alcohol is flammable. B) Alcohol has a lower boiling point than water. C) Alcohol has a lower melting point than water. D) Alcohol has a higher boiling point than water. please help. NO LINKS. What job do you want when your older and why?Most detailed answer gets brainliest, include pictures as well if you want.Just curious :) An assistant receives a wage of $16.24 per hour this amount is 112% of last year's wage what is the dollar increase in the hourly wage over last year use proportion method