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
A structure that organizes data in a list that is commonly 1-dimensional or 2-
kobusy [5.1K]

Answer:

An array.

Explanation:

An array can be defined as a structure that organizes data in a list that is commonly 1-dimensional or 2-dimensional.

Simply stated, an array refers to a set of memory locations (data structure) that comprises of a group of elements with each memory location sharing the same name. Therefore, the elements contained in array are all of the same data type e.g strings or integers.

Basically, in computer programming, arrays are typically used by software developers to organize data, in order to search or sort them.

Binary search is an efficient algorithm used to find an item from a sorted list of items by using the run-time complexity of Ο(log n), where n is total number of elements. Binary search applies the principles of divide and conquer.

In order to do a binary search on an array, the array must first be sorted in an ascending order.

Hence, array elements are mainly stored in contiguous memory locations on computer.

6 0
2 years ago
75,15,25,5,15 what's next
Fittoniya [83]

Answer:

3

Explanation:

The sequence seems to follow a 2-step pattern.

1)Divide the first number by 5 to get the second number.

2)Add 10 to the second number to get the third number.

75/5 = 15

15 + 10 = 25

25/5 = 5

5 + 10 = 15

---> 15/5 = [3] (Answer)

3 0
3 years ago
WHO IS EXCITED FOR COLD WAR SEASON 1????
xxMikexx [17]

Answer:

me  iggggggg

Explanation:

7 0
3 years ago
Read 2 more answers
If you have downloaded this book's source code from the companion Web site, you will find a file named text.txt in the Chapter 1
Lubov Fominskaja [6]

Answer:

Explanation:

The following python code loops through each line within a file called text.txt and counts all the words, then it divides this count by the number of sentences in the text file. Finally, output the average number of words per sentence.

f = open("text.txt", "r")

all_words = 0

sentences = 0

for x in f:

   list = x.split(' ')

   all_words += len(list)

   sentences += 1

average = all_words / sentences

print("There are an average of " + str(average.__round__()) + " words in each sentence.")

6 0
3 years ago
For those of u who watch Lucifer- S6 is coming out on Sept 10th
elixir [45]
Ight ty for the info
6 0
3 years ago
Other questions:
  • What was one of the main purposes of the first computer systems?
    11·1 answer
  • What was the first fully computer animated feature film?
    13·1 answer
  • (BRAINLIEST QUESTION) What are some challenges that will need to be overcome in order for the Internet of Vehicles to become a r
    13·1 answer
  • What type of memory or storage device is prone to losing data if the power goes out?
    5·1 answer
  • What is the name of the process that weighs the alternatives, gathers all necessary information, and can ultimately lead you to
    9·2 answers
  • What is local technology ? give examples​
    6·1 answer
  • If a file you are opening for appending does not exist, the operating system will detect the missing file and terminate the oper
    14·1 answer
  • The physical parts of Computer are kwon as<br>​
    15·1 answer
  • Which of the following lines of code correctly defines a function called combine? OA define "combine(a, b, c)" as: B. define(com
    9·1 answer
  • What is the purpose of memory address?​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!