Is there a solution to these questions c ++?

pLEASE DELET MY POST

Firstly, welcome to the forums.

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

It is pretty typical on here for people to share a codepen / repl.it / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile:

Yes, there are solutions. Copy-pasting your homework into here is not going to reveal any of them.

2 Likes

If you show us what you’ve tried, I can help you with debugging. But you’ve got to start somewhere with something.

I tried the solution, but my problem is in the condition. Just specify the condition to me, and I market I completely solve it. I ask you for the condition of the solution. In the sense, for example, in the first question, there was a condition when the price is greater than 100, it will be recorded in another file.

I tried the solution, but my problem is in the condition. Just specify the condition to me, and I market I completely solve it. I ask you for the condition of the solution. In the sense, for example, in the first question, there was a condition when the price is greater than 100, it will be recorded in another file.

I’m not quite good enough to debug your code on your computer without looking (usually). Can you paste your code into a post here?

You will want to use the </> button in the post formatting options or put ``` on new lines before and after your block of code.

ffefdsrfesfesfeserfefesfesfsfsefsefesf esf ef es fes fes ggedsgredsgesges

And what are the problems you’re having with the code? What output are you expecting? What are you getting instead?

I suggest that you start engaging with us here like we’re people eager to help and not a free service.

There are two things I notice.

The instructions want you to read the original file and write out to a new file the items that are priced over $100. You are

  1. using your original arrays (that I don’t think you are supposed to have) and
  2. writing out to a new file the items that are priced over or equal to $100.

After that, the program reads the previous file and writes the items that are priced over $100 in a separate file (prices_100.txt).

The instructions say that you need to read in the file and if there is an item priced greater than $100 to write it out into a separate file. You have all of the pieces of this logic, but jumbled up.

I want the condition i.e. in IF if any condition is set, even if the price exceeds 100, the file will be created

I don’t understand what you are saying.

The instructions say:

  1. Read 50 names and items from the user and write them to prices.txt
  2. Read prices.txt and write any items that are prices greater than $100 to prices_100.txt

Your 1. is correct. You have 2. partially correct, except you are not quite doing things in the correct order.

What are you seeing that is not what you expect from this snippet of code?