Tutor profile: Chintan S.
Subject: Computer Science (General)
When is the following Boolean expression true (x, y, and z are integers): [(x >= z) && (z < y)] && (x > y) a) Always b) Never c) x = y = z d) x > y > z e) x < y < z
Solve this first by testing a base case, in this case, the easiest answer choice to test is x = y = z. If all values equal 6, then the second full condition would not work --> (x > y), therefore we can eliminate c. Then attempt to find a test case that does work for the expression. Reading from left to right, assign different values for the integers to find a solution for this expression. The first variable I see is x, which I will randomly assign the value of 50. x has to be greater than or equal to z, so z can either be 50 or 25 (random assign). z has to be less than y but before we look at the secondary condition, looking at the second condition we see that x > y so we know that x > y and y > z to find the solution of x > y > z, which is answer choice d.
The state of Georgia has a market basket that consists of peaches and peanuts. 40 peaches and 10 pounds of peanuts make up the market basket, and in 2015 the price per unit for peaches and peanuts was $4 per peach and $10 per pound of peanuts. From then, the price per peach has increased by $1, and the price per pound of peanuts increased by $2. Based on this information, calculate the price index from this year in Georgia with 2015 as the base year.
Calculate the base year market basket value by solving the following: (4 *40) + (10 * 10), which solves to be $260. Then the current year market basket value calculation will be calculated by adding the increases to the current prices and multiplying them by the amount of the baskets. This is calculated as follows: (40 * (4+1)) + (10 * (10+2)), which equals 320. The price index is then 320 divided by 260 and then multiplied that value by 100, which equals to approximately 123.
An SUV averages 34 miles per gallon. If gas costs $3.23 per gallon, which of the following is the closest to how much gas would cost for this SUV to travel 3,434 miles?
To solve this quickly, simply set up a ratio between the average miles per gallon and the number of miles that you are being asked to travel. The ratio starts as 3,434: 34, which can be simplified to 101: 1. To solve you simply add $323 (which is $3.23 *100) to $3.23 to get your final answer of 326.23 faster than simply using your calculator.