From 8bdd94894d3e0ae91a211530f2aaccf2b3ff3a16 Mon Sep 17 00:00:00 2001 From: Vivek Kumar Singh <64981263+singhvivekkumar@users.noreply.github.com> Date: Mon, 25 Oct 2021 10:28:19 +0530 Subject: [PATCH 1/3] Create find_word.java --- find_word.java | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 find_word.java diff --git a/find_word.java b/find_word.java new file mode 100644 index 0000000..f4e3f10 --- /dev/null +++ b/find_word.java @@ -0,0 +1,27 @@ +// WAP enter a sentence form keyboard and also find all the words in that +// sentence with starting character as vowel +import java.util.Scanner; +class Assginment2 +{ + public static void main(String[] arg) + { + String store="\n"; + char vowel=a; + Scanner sc=new Scanner(System.in); + System.out.print("Enter a string : "); + String take=sc.nextLine(); + String[] arr=take.split(" "); + for (String s : arr) + { + System.out.println(s); + int le=s.length(); + String[] arr2=new String[le]; + arr2= + if (arr2[0]==vowel) + { + store+=s; + } + } + System.out.println("These are the words which start with vowel : "+store); + } +} From 34f3468ee849ccd9866a5a515bc655a28177e3c7 Mon Sep 17 00:00:00 2001 From: Vivek Kumar Singh <64981263+singhvivekkumar@users.noreply.github.com> Date: Mon, 25 Oct 2021 10:28:37 +0530 Subject: [PATCH 2/3] Create README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..83c66b0 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# HacktoberFest2021-2 +A beginner-friendly project to help you in open-source contributions. Made specifically for contributions in HACKTOBERFEST 2021. Please leave a star ⭐ to support...… From 5711a6713b29d468c33eb12d7d9bd76c88977d47 Mon Sep 17 00:00:00 2001 From: Vivek Kumar Singh <64981263+singhvivekkumar@users.noreply.github.com> Date: Mon, 25 Oct 2021 14:11:11 +0530 Subject: [PATCH 3/3] create book store This is created in python and using sqlite3 database for storing data. --- bookstore/bookdata.db | Bin 0 -> 16384 bytes bookstore/file1.py | 60 ++++++++++++++++++++++++++++++++++++++++++ bookstore/file4.py | 34 ++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 bookstore/bookdata.db create mode 100644 bookstore/file1.py create mode 100644 bookstore/file4.py diff --git a/bookstore/bookdata.db b/bookstore/bookdata.db new file mode 100644 index 0000000000000000000000000000000000000000..e9dc3b6db18dd33a5ceeecf1f246e16ee965f2df GIT binary patch literal 16384 zcmeI&J#P~+7zc3M$t7wFbz8NZG8CDjibRbNg0V}}>V!hmG+eKUPSK^gByR4dy*QN+ zLZ}O3LM(`hg^`huz|?_>iBG`9g!lmX(k2uM=zn)nP!9nJKmY;| zfB*y_009U<00I|I;ElPwOpn%;+wi^Kfv-2BJ=Jf@sII(Vzy7yydd;>8P0c%~VE}`Opo#qV8EZn$2X*`FVQucra!%FJJc5FlWDvGK`A+>d*OGcP(4g z?D9s*-Vy88jwo$Ao8_wRxMAtl31_r6k-vSbAgY^=sBTv(MNvAlPBB_#GF~Csn`d}H z_*edszvHj@Qy%aa7w(^i1wjA;5P$##AOHafKmY;|fB*#kpTJbcAaf?`sKB?Qj#Tv7 z6~iFcOm@#bbbGt8+*h{S>HFlQi&YX@6yQ20;f7=Mlq4MIe*KvK97H6nIawa>ec_0tHE;&y2|CE0t z`iBGo2tWV=5P$##AOHafKmY;|fWUcNcl3<*8!5-0>v4oqjQXHZLiy9XHVZRAYb(P|Cm1i N-yhrzI6OK3{{eWX-Kziq literal 0 HcmV?d00001 diff --git a/bookstore/file1.py b/bookstore/file1.py new file mode 100644 index 0000000..f1cab2c --- /dev/null +++ b/bookstore/file1.py @@ -0,0 +1,60 @@ +import sqlite3 +con = sqlite3.connect('bookdata.db') +cur = con.cursor() + +def add(): + while (True): + try: + myid = int(input("Enter Id:\t")) + myname = input("Enter Title:\t ") + myauthor = input("Enter Author:\t ") + mymarks = int(input("Enter Price:\t ")) + cur.execute("INSERT INTO booklist(Book_id, Title, Author, Price) VALUES (?,?,?,?);",(myid, myname, myauthor, mymarks)) + con.commit() + print("You Succesfully Added data") + except: + print("You Entered some wrong Data ") + + user_choice2 = "" + while (user_choice2 != "c" and user_choice2 != "q"): + print("Press q to quit and c to If you want add more data") + user_choice2 = input("Enter") + if user_choice2 == "q": + exit() + elif user_choice2 == "c": + continue + else: + print(f" you write wrong \n{ user_choice2} is a not vaild optaion") + +def display(): + print("Book_id\t Title\t Author\t Price\n") + vv = cur.execute("SELECT * FROM booklist") + for i in vv: + print(i[0], "\t", i[1], "\t====>>", i[2], "\t", i[3]) + con.close() + +def Updating(): + print("here you can change price of any book") + user = input("Enter Title Which you want to update:") + cur.execute("SELECT price FROM booklist WHERE title='" +user+ "';") + record = cur.fetchone() + print(f"The old price of {user} book is {record}") + user2 = input("Now Enter new price :") + con.execute("UPDATE booklist SET price='"+user2+"' WHERE title='"+user+"' ") + con.commit() + print("Record updated sucessfully") + + +if __name__ == '__main__': + print("hello to VIVEK bookstroe database \nEnter Your choice ") + take = int(input("1 for Add \t 2 for Name of Books \t 3 for updating price\nYour choice:\t")) + if take==1 : + print(add()) + elif take==2 : + print(display()) + elif take == 3 : + print(Updating()) + else: + print("Error !!!. You entered wrong data ") + + diff --git a/bookstore/file4.py b/bookstore/file4.py new file mode 100644 index 0000000..5c13a6d --- /dev/null +++ b/bookstore/file4.py @@ -0,0 +1,34 @@ +import sqlite3 +con = sqlite3.connect("bookdata.db") +cur = con.cursor() +print("Welcome to VIVEK Bookstrore.") +while True: + + value = input("Enter book Title :") + sql = cur.execute("SELECT price FROM booklist WHERE title='" + value + "';") + record = cur.fetchone()[0] + if record == None: + print(f"Sorry sir currently not avilable! \nWe will try to get {value} book for you Next time") + else: + print(f"Yes Sir, we have it in stock. It costs Rs{record}. Would you like to take it?") + ask = int(input("1 for yes and 2 for No :")) + if ask == 1: + copies = int(input("How many copies :")) + print("Sure. Anything else, Sir?") + user_choice2 = "" + while (user_choice2 != "Yes" and user_choice2 != "No"): + user_choice2 = int(input("Enter :")) + if user_choice2 == "No": + amount =sum( record * copies) + print( f"Book Title :\t{value}\nPrice of Book:\t{record}\nTotal amount:\t{amount}\nThank you Sir, Visit again. Have a good day") + + elif user_choice2 == "Yes": + continue + + else: + print(f"you write wrong \n Yes & No is a not vaild optaion") + elif ask == 2: + print(f"Thanks for asking {value} book ") + + +