From ef3371d94b24964a811c19ec0fbc5ed5bbee580a Mon Sep 17 00:00:00 2001 From: Vedant Date: Sat, 10 Feb 2024 16:22:35 -0500 Subject: [PATCH] Adding files from problem 8 --- .DS_Store | Bin 0 -> 6148 bytes INSTALL.md | 1 + README.md | 6 ++++- git-lab1 | 1 + gitignore | 0 index.html | 40 ++++++++++++++++++++++++++++++++ problem1.js | 45 ++++++++++++++++++++++++++++++++++++ problem2.py | 27 ++++++++++++++++++++++ style.css | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 .DS_Store create mode 100644 INSTALL.md create mode 160000 git-lab1 create mode 100644 gitignore create mode 100644 index.html create mode 100644 problem1.js create mode 100644 problem2.py create mode 100644 style.css diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f1e9f88086e310441931a9965b3a57f81a42e641 GIT binary patch literal 6148 zcmeHK%}T>S5T317w-g}<1&<3}E4Efd@e-oGfDt{Y)Pxod#;i1{J(NPu`a(X5&*RMQ z1}yEtlZc&x-EVe&b~7Jje*i!Pqkad#0|1GQP>`}f$h^>1bHRkd%#lI_F?8Z_{<2`A zzi6Uwm+$}y6tD~5zCTWNjJ}WfB~9|8-ToA{mHO)1x?Gn{c^5wFaacsfC=a6H4UI0f zPUA|C;;UpZ?s=Q1IxC_i8w^cC(jQ>R?RAp%^*GR@te>0Q&^ly8HhSLnWU_yB+)~|c zXWCMeG`9?)0iRq>3> z05iZ0FayiOfI9;D-#*{-CfC`VLErX6wL?uFvGJ6Oy1#ZwW%>(05o` zL=TFvsfadJxF?3N>1bCj&UaW^wCNzs$~cc(xq7?^vpU+92?ya@RX bk&bb`!_p$nLUxmm$QJ=a2zSiDFEH>0v?@!p literal 0 HcmV?d00001 diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..e5fe9a9 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1 @@ +# Installation Instructions diff --git a/README.md b/README.md index 4fed924..2c88f4d 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ -# Git Lab 1 +# Vedant Chanshetty + +**The “RESOURCES”** + +* https://stackoverflow.com/questions/3003476/get-underlined-text-with-markdown diff --git a/git-lab1 b/git-lab1 new file mode 160000 index 0000000..39fb019 --- /dev/null +++ b/git-lab1 @@ -0,0 +1 @@ +Subproject commit 39fb0194abf6a915ecf44bb25ede7d8dbbd665e4 diff --git a/gitignore b/gitignore new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html new file mode 100644 index 0000000..88f7ada --- /dev/null +++ b/index.html @@ -0,0 +1,40 @@ + + + + + + +
+ +
+
+
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + +
+ +
+ + \ No newline at end of file diff --git a/problem1.js b/problem1.js new file mode 100644 index 0000000..428c99f --- /dev/null +++ b/problem1.js @@ -0,0 +1,45 @@ +let input = process.argv[2] //must be entered within single quotes (ex: '$9.87') + +let cleanInput; + +//ensures input is valid +if ((!input)||(input[0] != "$")){console.log("The string must begin with a $")} +else{ + cleanInput = input.replace("$","") + + if (cleanInput[0] == "."){console.log("The string must include a dollar amount")} + + else{ + //split input into dollars and cents + let dotIndex = cleanInput.indexOf(".") + if(dotIndex != -1){ + dollars = cleanInput.substring(0,dotIndex) + cleanInput = cleanInput.substring(dotIndex+1) + } + + //find values of each denomination + dollarInt = Number(dollars); + dollars = [" dollar", " dollars", dollarInt] + centsInt = Number(cleanInput) + + let quarters = [" quarter", " quarters", Math.floor(centsInt/25)] + centsInt = centsInt % 25 + + let dimes = [" dime"," dimes",Math.floor(centsInt/10)] + centsInt = centsInt % 10 + + let nickels = [" nickel"," nickels",Math.floor(centsInt/5)] + centsInt = centsInt % 5 + + let pennies = [" penny"," pennies",centsInt] + + //for each loop to go thru all denoms and output + for (x of [dollars,quarters,dimes,nickels,pennies]){ + if(x[2]>0){ + if(x[2]==1){console.log(x[2]+x[0])} + else{console.log(x[2]+x[1])} + } + } + +} +} diff --git a/problem2.py b/problem2.py new file mode 100644 index 0000000..47d1f70 --- /dev/null +++ b/problem2.py @@ -0,0 +1,27 @@ +import sys + +input = ' '.join(sys.argv[1:]) +if not input: + print("You must provide at least one string") +else: + inputList = input.split() + + lowercaseList = inputList.copy() + for x in range(len(lowercaseList)): + lowercaseList[x] = lowercaseList[x].lower() + + output = [] + for x in range(len(lowercaseList)): + for i in range(len(lowercaseList)): + if(x!=i): + if lowercaseList[x] == lowercaseList[i]: + found = False + for z in range(len(output)): + if inputList[x].lower() == output[z].lower(): + found = True + if not found: + output.append(inputList[x]) + + + for x in output: + print(x) diff --git a/style.css b/style.css new file mode 100644 index 0000000..13202c4 --- /dev/null +++ b/style.css @@ -0,0 +1,64 @@ +*{ + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: 'Times New Roman', Times, serif; +} + +#background{ + background-color: #8a8a8d ; + height: 100vh; + width: 100vw; + +} + +#console{ + background-color: #346094 ; + color: #FFFFFF; + border: 2px solid black; + position: absolute; + top: 50%; + left: 50%; + transform:translate(-50%,-50%); + height:max-content; + width:max-content; + padding: 1%; + display: flex; + flex-direction: column; + width: 80vw; + height: 70vh; +} + +.option { + flex-grow: 1; + display: flex; + align-items: center; + font-size: 25pt; +} +.option > label { + margin: 10px; + flex-grow: 1; + text-align: center; +} +.option > input[type='text']{ + flex-grow: 1; + font-size: 20pt; +} + +input[type="radio"]{ + display: none; +} + +button{ + font-size: 30pt; +} + +input[type='radio'] + label { + background: #8a8a8d; + border: 2px solid black; + padding: 1%; +} +input[type='radio']:checked + label { + font-size: 30pt; + background: lightpink; +} \ No newline at end of file