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
kotykmax [81]
2 years ago
5

Please help me to creat flow chart tq​

Computers and Technology
1 answer:
Marina CMI [18]2 years ago
4 0

Using the knowledge in computational language in C it is possible to write a code that uses a class called "books". Data members of this class are author, title, price, publisher and stock position.

<h3>Writting the code in C++</h3>

<em>#include<iostream.h></em>

<em>#include<conio.h></em>

<em>#include<stdio.h></em>

<em>#include<string.h></em>

<em />

<em>//declaration of class books</em>

<em>class books</em>

<em>{</em>

<em />

<em>//data members of books class</em>

<em>public:</em>

<em>char author[20];</em>

<em>char title[20];</em>

<em>char publisher[50];</em>

<em>int price;</em>

<em>int copies;</em>

<em>int stock;</em>

<em />

<em>//setData() function to set data of books</em>

<em>void setData()</em>

<em>{</em>

<em>cout<<"\nEnter the following details:\nAuthor's Name:";</em>

<em>gets(author);</em>

<em>cout<<"\nTitle :";</em>

<em>gets(title);</em>

<em>cout<<"\nPublisher :";</em>

<em>gets(publisher);</em>

<em>cout<<"\nPrice :";</em>

<em>cin>>price;</em>

<em>cout<<"\nNumber of copies:";</em>

<em>cin>>copies;</em>

<em>stock=1;</em>

<em>}</em>

<em />

<em>//check() function to check if a book is available or not</em>

<em>void check()</em>

<em>{</em>

<em>char t[20],aut[20];</em>

<em>int cop;</em>

<em>cout<<"\nEnter the following details to search for book:\n";</em>

<em>cout<<"\nTitle of the book:";</em>

<em>gets(t);</em>

<em>cout<<"\nEnter Author's Name :";</em>

<em>gets(aut);</em>

<em>cout<<"\nNumber of copies:";</em>

<em>cin>>cop;</em>

<em>if(strcmp(t,title) & strcmp(aut,author) & (cop<=copies))</em>

<em>{</em>

<em>cout<<"\nBook is availabe in store\nPrice = "<<cop*price;</em>

<em>copies-=cop;</em>

<em>}</em>

<em>else</em>

<em>{</em>

<em>cout<<"Not available";</em>

<em>}</em>

<em>}</em>

<em>};</em>

<em />

<em />

<em>void main()</em>

<em>{</em>

<em>clrscr();</em>

<em>books bk;</em>

<em>bk.setData();</em>

<em>bk.check();</em>

<em>getch();</em>

<em>}</em>

See more about C code at brainly.com/question/17544466

#SPJ1

You might be interested in
The rules on the Internet for how messages are addressed and passed on are called ____ .
olganol [36]
Answer: Internet Protocal (IP)
7 0
3 years ago
What is one way in which tablets differ from laptops and notebooks
olga55 [171]
One way is the tablet is more portable in the hand and has a virtual keyboard.

6 0
4 years ago
Read 2 more answers
Name this<br><br>The feature allows you to add text/picture in the background of the document. ​
sertanlavr [38]
I think it is picture/text wrapping

I wouldn’t trust this though

I’m sorry if it’s wrong
4 0
3 years ago
How do you select from the insertion point to the beginning of the current line?
Neko [114]

Answer:

Press the Shift key, then press the Home key.

Explanation:

This is because Home key take you to a beginning of a line and shift selects.

Have a nice day!

Please mark as brainiest if this helped you! :)

4 0
3 years ago
How do i build a supercomputer.?
stira [4]
You will need one head node, at least a dozen identical compute nodes, an Ethernet switch, a power distribution unit, and a rack. Determine the electrical demand, cooling and space required. Also decide on what IP address you want for your private networks, what to name the nodes, what software packages you want installed, and what technology you want to provide the parallel computing capabilities
3 0
4 years ago
Other questions:
  • Answer the following questions:
    7·1 answer
  • A Unit of information containing the objects position, rotation, and scale values is called:
    13·1 answer
  • The major types of wireless media are______________.
    6·1 answer
  • In filmmaking, who is ultimately responsible for the creative process?
    15·1 answer
  • Hey guys!
    5·2 answers
  • Laura is filming a scene in which the subject is sitting with a lit fireplace behind him. The only other source of light in the
    5·1 answer
  • Explain the working principle of computer with suitable diagram​
    15·1 answer
  • Which of the following terms means the computer operating system automatically detects and installs the proper driver for a new
    9·1 answer
  • Marcus traded in his 10-year-old truck for a new one. Because it is the first new truck he
    9·1 answer
  • Mary and Billy are moving away to college and both know in their hearts that they need to end their relationship. They move away
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!