How to write a function to generate a new Book with random arguments(name, pages, price) | SoloLearn: Learn to code for FREE!

0

How to write a function to generate a new Book with random arguments(name, pages, price)

struct Book { string name; int pages; int price; }; int randStudent() { }

1/15/2021 3:27:17 PM

zaya1235

4 Answers

New Answer

+2

zaya1235 is there any initial data for the name ,pages and price of book? Because it doesn't makes sense to generate a random book name "cydzs" with some random price and pages .

0

Abhay i think you should enter name manually. Pages and price should be in some kind of range. Like up to 1000 pages and price up to 300

0

Abhay so basically later you create an array of book and fill it by using that function

0

zaya1235 so what do you want to do in actual? Can you give an example program with possible inputs and outputs ? Also please show us the code you have attempted so far ,for me it is difficult to figure out what you are really looking for .