A housing society is represented by a 3D plane. We have a class house which
stores the location of a house of three persons using x, y and z coordinates of
plane. Another class market which stores the location of a main market. Each class
should initialize the data members using parameterized constructor. Keep the data
members of all the classes private. Also display the location of houses and market.
Calculate the distance of houses of all the persons from the market and display
which person’s house is far away from the market. Also display which person has
nearest distance from the market.
The class manager has the access to both class house and market so it swaps the
location of the market with the house of a person that has the largest distance
with the market. in C++
Draw a flowchart that uses while loops to perform the following steps:
a. Prompt the user to input two integers: firstNum and secondNum. (firstNum must be less than secondNum.)
b. Output all the odd numbers between firstNum and secondNum inclusive.
c. Output the sum of all the even numbers between firstNum and secondNum inclusive.
d. Output all the numbers and their squares between 1 and 10.
e. Output the sum of the squares of all the odd numbers between firstNum and secondNum inclusive.
for i in displayList:
print(i[0])
#loop through displayList
for i in range(0,len(displayList)):
#Test if the fist item in the current sub-list contains the text "Price Level
#Tip: Remeber that each sub-list is a (displayList). So you have
# to access its items via displayList followed by TWO indexes.
......
#Extract the second item from the currnet sub-list into variable called priceLevel
priceLevel = ...
#Test if priceLevel is between previousPrice and currentPrice OR
# priceLevel == previousPrice OR
# priceLevel == currentPrice
if....
:
#Sound the alarm. Pass in the frequency and duration.
if self.__currentPrice > self.__previousPrice:
frequency = 800
duration = 700
else:
frequency = 400
duration = 700
winsound.Beep(frequency, duration)
#Print the text 'Alarm' with a green background color, so that the user
#can go back and check when the alarm was sounded.
...