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
Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value is consi
Darya [45]

// Variable to keep track of array size

int length = 0;

// Array itself

int array[] = {};

// while loop will take input in the array until a negative number is entered

while(input>=0){

stdin = new Scanner(System.in);

array[length] = stdin;

length +=1;

}

// int variable to terminate while loop

int i =0;

// keep track of index of output array

int y =0;

while(arr[i] != length){

// making output array

int output[]={}; bool flag;

// put the element in out put array considering if it the desired one

output[y] = array [i];

// Now check if it was the desired?

for(int z=1;z<=length;z++){

if(array[i+z]!=output[y]){

 flag = true;

}

else

{

 output[y]=0;

 y+=1;

}

if(array[i+z+1]=output[y] && flag == true){

output[y] = array[i];

y+=1;

}

}

//output the array

for(int o=0;o<y;o++)

System.out.println(output[o];

3 0
3 years ago
Write a function number_of_pennies() that returns the total number of pennies given a number of dollars and (optionally) a numbe
katovenus [111]

Answer:

The function is as follows:

def number_of_pennies(dollars,pennies=0):

   return dollars*100+pennies

   

Explanation:

This defines the function

def number_of_pennies(dollars,pennies=0):

This returns the number of pennies

   return dollars*100+pennies

<em>Note that, if the number of pennies is not passed to the function, the function takes it as 0</em>

5 0
2 years ago
Read 2 more answers
Select all of the following statements regarding security policy that are true.
a_sh-v [17]

Answer:

C and D

Explanation:

Your company should have a written security policy, and all employees should have access to the policy, even if they're casual workers.

Also, Training on computer security should be provided for all staff members as a prerequisite to start work.

3 0
3 years ago
A walk-through of the project deliverable is conducted by<br> __
prisoha [69]
A walk through of the project deliverable is conducted by: the sellers agent
5 0
3 years ago
Dana is moving to a new house. She has 15 boxes for books. Each box can hold up to 22 books. Dana has 375 books. How many more b
Snezhnost [94]

Answer:

3

Explanation:

no of boxes 15

each box hold 22 books

then 15×22=330 books occupied

left books are 375-330=45

so 45÷15=3 boxes will be need

3 0
3 years ago
Read 2 more answers
Other questions:
  • During the ________ phase of the systems development life cycle process, developers construct, install, and test the components
    13·1 answer
  • Select the correct answer. Trackers are associated with which audio format?
    6·1 answer
  • ​if a primary key combines two or more fields, then it is called a _____.
    14·1 answer
  • For questions 19 - 21, assume that Student, Employee and Retired are all subclasses of Person, and all four classes have differe
    9·1 answer
  • Which of the following is part of the cycle of dating violence
    8·1 answer
  • What is a bitmap ???
    13·2 answers
  • Your classmate is frustrated because the code that was designed to add up her five quiz grades is not working properly.
    12·1 answer
  • What is ABC computer?​
    14·1 answer
  • What are the four steps for planning a table?​
    10·1 answer
  • Submit your business presentation that clearly compares and contrasts three different cell phone service plans..
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!