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]
1 year ago
5

Please help me to creat flow chart tq​

Computers and Technology
1 answer:
Marina CMI [18]1 year 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
Emily has to create an audio-visual presentation on animated movies. Which input device will she be LEAST likely to use while cr
Slav-nsk [51]
A joystick is less likely to be used while creating this presentation. Obviously, If your intention is to create an audio-visual presentation on animated movies, a computer should be used. With a computer, comes a keyboard, a mouse and a microphone as well.

A Joystick is used to control video games and play simulator games. Therefore, I do not see the need of using a joystick in this situation.

6 0
3 years ago
The link for notepad is located by default in the _______ menu.
jolli1 [7]
B. Accessories. Notepad, like many other useful tools, is located within the accessories area.
5 0
3 years ago
As the internet continues to expand and become vital to everyday life, it may become more regulated with rules just like our eve
denis23 [38]
I can't see all of option D, but it is potentially correct. Please tell me what option D is and I will tell you if it is option "B" or option "D."
5 0
3 years ago
Read 2 more answers
What is the output of the following code: ​ for (loop = 1; loop &lt;3; ++loop) System.out.print(1); for (loop2 = 1; loop2&lt;3;
Mama L [17]

Answer:

The output of the given code as follows:

<u>Output: </u>

1122

Explanation:

In the given java code the two for loop is defined, which can be described as follows:

  • In the first loop, a"loop" variable is used, which starts from 1 and ends when the value of loop is less than 3, inside the loop a print function is used, that print value 1.
  • In the next step, another for loop is declared, inside the loop a variable "loop2" variable is used, that's working is the same as the above loop, but in this loop, it will print a value, that is 2.
7 0
3 years ago
What other kinds of toolbars exist in addition to those that are part of individual programs?
Stells [14]
<span>A. toolbars that appear on the taskbar

</span><span>D. the process of allocating uses and resources for a server</span>
6 0
3 years ago
Other questions:
  • Which type of object is used to organize and store data in Microsoft access 2013
    5·2 answers
  • Marie uses a browser to visit a blog. What is the unique identifier of the blog?
    13·2 answers
  • Which statement is true about customizing presentation programs?
    9·1 answer
  • What careers are most likely to require business skills
    13·1 answer
  • 1. A pure aggregator is best defined as a blog that
    9·1 answer
  • as the new hr manager hired by a company to clean up some of the company's problems,analyse the system requirements for the comp
    14·1 answer
  • Samm1E49 ok my username is mosarider489 also if others want to join u can friend me
    8·2 answers
  • Identify a logical operation (along
    5·1 answer
  • What is the output of this program?
    10·2 answers
  • Help<br> pls need quickly
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!