Skip to content

Instantly share code, notes, and snippets.

@ganeshbabuNN
ganeshbabuNN / lieDetector.java
Last active April 8, 2024 14:03
EPGPSD2024_Precendence Order of Logical Operators
/*
Description
Assume that you have built a lie detector which detects the level of chemicals X and Y.
If the sum of the amounts of X and Y is greater than 30, then the person is telling the truth.
Write Java code to take in the values of X and Y and detect whether the person is telling the truth or not. If the person is telling the truth, display "The statement said by the person is true". If the person is lying then display "The statement said by the person is false".
Sample input:
12
23
Sample output:
The statement said by the person is true
@ganeshbabuNN
ganeshbabuNN / LieDetector1.java
Last active April 8, 2024 14:03
EPGPSD2024_Precendence Order of Logical Operators
/* Description Assume that you have made some modifications to make the lie detector more sensitive and accurate.
You will be taking chemicals X,Y, A and B as inputs. Also, you will take the heart rate(heartRate) as input.
The person is telling the truth if all the following conditions are met: Sum of amounts of X and Y is greater than 30 Either A is greater than 3 or B is less than 6 Heart rate is equal to 70
The first four lines of input will have X,Y,A and B as inputs in that particular order. The next line of input will have the heart rate. If the person is telling the truth, display "The statement said by the person is true".
If the person is lying then display "The statement said by the person is false".
*/
import java.util.*;
public class Source {
public static void main(String[] args) {
Name Team Number Position Age Height Weight College Salary
Avery Bradley Boston Celtics 0.0 PG 25.0 6-2 180.0 Texas 7730337.0
Jae Crowder Boston Celtics 99.0 SF 25.0 6-6 235.0 Marquette 6796117.0
John Holland Boston Celtics 30.0 SG 27.0 6-5 205.0 Boston University
R.J. Hunter Boston Celtics 28.0 SG 22.0 6-5 185.0 Georgia State 1148640.0
Jonas Jerebko Boston Celtics 8.0 PF 29.0 6-10 231.0 5000000.0
Amir Johnson Boston Celtics 90.0 PF 29.0 6-9 240.0 12000000.0
Jordan Mickey Boston Celtics 55.0 PF 21.0 6-8 235.0 LSU 1170960.0
Kelly Olynyk Boston Celtics 41.0 C 25.0 7-0 238.0 Gonzaga 2165160.0
Terry Rozier Boston Celtics 12.0 PG 22.0 6-2 190.0 Louisville 1824360.0
Pokemon Type
Bulbasaur Grass
Ivysaur Grass
Venusaur Grass
Charmander Fire
Charmeleon Fire
Charizard Fire
Squirtle Water
Wartortle Water
Blastoise Water
First Name Gender Start Date Last Login Time Salary Bonus % Senior Management Team
Douglas Male 8/6/1993 12:42 PM 97308 6.945 true Marketing
Thomas Male 3/31/1996 6:53 AM 61933 4.17 true
Maria Female 4/23/1993 11:17 AM 130590 11.858 false Finance
Jerry Male 3/4/2005 1:00 PM 138705 9.34 true Finance
Larry Male 1/24/1998 4:47 PM 101004 1.389 true Client Services
Dennis Male 4/18/1987 1:35 AM 115163 10.125 false Legal
Ruby Female 8/17/1987 4:20 PM 65476 10.012 true Product
Female 7/20/2015 10:43 AM 45906 11.598 Finance
Angela Female 11/22/2005 6:29 AM 95570 18.523 true Engineering
name mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21 6 160 110 3.9 2.62 16.46 0 1 4 4
Mazda RX4 Wag 21 6 160 110 3.9 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.32 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.44 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.46 20.22 1 0 3 1
Duster 360 14.3 8 360 245 3.21 3.57 15.84 0 0 3 4
Merc 240D 24.4 4 146.7 62 3.69 3.19 20 1 0 4 2
Merc 230 22.8 4 140.8 95 3.92 3.15 22.9 1 0 4 2
Year Population Total Violent Property Murder Forcible_Rape Robbery Aggravated_assault Burglary Larceny_Theft Vehicle_Theft
1960 179323175 3384200 288460 3095700 9110 17190 107840 154320 912100 1855400 328200
1961 182992000 3488000 289390 3198600 8740 17220 106670 156760 949600 1913000 336000
1962 185771000 3752200 301510 3450700 8530 17550 110860 164570 994300 2089600 366800
1963 188483000 4109500 316970 3792500 8640 17650 116470 174210 1086400 2297800 408300
1964 191141000 4564600 364220 4200400 9360 21420 130390 203050 1213200 2514400 472800
1965 193526000 4739400 387390 4352000 9960 23410 138690 215330 1282500 2572600 496900
1966 195576000 5223500 430180 4793300 11040 25820 157990 235330 1410100 2822000 561200
1967 197457000 5903400 499930 5403500 12240 27620 202910 257160 1632100 3111600 659800
1968 199399000 6720200 595010 6125200 13800 31670 262840 286700 1858900 3482700 783600
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
ame calories sodium alcohol cost
Budweiser 144 15 4.7 0.43
Schlitz 151 19 4.9 0.43
Lowenbrau 157 15 0.9 0.48
Kronenbourg 170 7 5.2 0.73
Heineken 152 11 5.0 0.77
Old_Milwaukee 145 23 4.6 0.28
Augsberger 175 24 5.5 0.40
Srohs_Bohemian_Style 149 27 4.7 0.42
Miller_Lite 99 10 4.3 0.43
order_id quantity item_name choice_description item_price
1 1 Chips and Fresh Tomato Salsa NULL $2.39
1 1 Izze [Clementine] $3.39
1 1 Nantucket Nectar [Apple] $3.39
1 1 Chips and Tomatillo-Green Chili Salsa NULL $2.39
2 2 Chicken Bowl [Tomatillo-Red Chili Salsa (Hot), [Black Beans, Rice, Cheese, Sour Cream]] $16.98
3 1 Chicken Bowl [Fresh Tomato Salsa (Mild), [Rice, Cheese, Sour Cream, Guacamole, Lettuce]] $10.98
3 1 Side of Chips NULL $1.69
4 1 Steak Burrito [Tomatillo Red Chili Salsa, [Fajita Vegetables, Black Beans, Pinto Beans, Cheese, Sour Cream, Guacamole, Lettuce]] $11.75
4 1 Steak Soft Tacos [Tomatillo Green Chili Salsa, [Pinto Beans, Cheese, Sour Cream, Lettuce]] $9.25
total_bill tip sex smoker day time size
16.99 1.01 Female No Sun Dinner 2
10.34 1.66 Male No Sun Dinner 3
21.01 3.5 Male No Sun Dinner 3
23.68 3.31 Male No Sun Dinner 2
24.59 3.61 Female No Sun Dinner 4
25.29 4.71 Male No Sun Dinner 4
8.77 2 Male No Sun Dinner 2
26.88 3.12 Male No Sun Dinner 4
15.04 1.96 Male No Sun Dinner 2