Answer:
- from matplotlib import pyplot as plt
-
- with open("text.txt") as file:
- data = file.readlines()
- category = []
- amount = []
- for row in data:
- values = row.split(" ")
- category.append(values[0])
- amount.append(float(values[1]))
-
- figure = plt.figure()
- ax = figure.add_axes([0,0,1,1])
- ax.axis('equal')
- ax.pie(amount, labels = category, autopct='%1.2f%%')
- plt.show()
Explanation:
Firstly, we need to import matplotlib library (Line 1).
Next, open a file stream and use readlines method to read the data from the text file (Line 4). Presume the data read from the text files are as follows:
Rent 450
Gas 150
Food 500
Clothing 120
Car 600
Create two lists, category and amount (Line 5-6). Use a for loop to traverse through the read data and use split method to break each row of data into two individual items. The first item is added to category list whereas the second item is added to amount list (Line 7 - 10).
Next, create a plot figure and then add the axes (Line 12 - 13). We can use the pie method to generate a pie chart (Line 15) by setting the amount list as first argument and category list as value of labels attributes. The output pie chart can be found in the attachment.
Answer:
Explanation:
We can use for-loop in python to calculate the tuition amount in the next 5 years. If the tuition is increasing 3% each year, in each loop we can multiply the amount by 1.03
tuition = 8000
for year in range(1,6):
tuition *= 1.03
print("The tuition amount after " + str(year) + " year(s) is $" + str(tuition))
Answer: Variety
Explanation:
According to the given question, Haley is dealing with the variety of the organization products posts on the social media networking as Haley's employer wants to comping all the data or information related to the products into the database system.
- The database is one of the type of management system that manages all the database that are shared by the customers or users.
- The main important function of the database is that it organize the data more accurately and properly in the system.
- The database management system (DBMS) handle all the data in the system more effectively from the variety of the users.
Therefore, Variety is the correct answer.
Answer:
if(goodsSold>500000){
bonus = 10000;
}
Explanation:
A complete Java program that prompts user to enter value for goodsSold is given below:
<em>import java.util.Scanner;</em>
<em>public class num14 {</em>
<em> public static void main(String[] args) {</em>
<em> Scanner in = new Scanner(System.in);</em>
<em> System.out.println("Enter goods Sold: ");</em>
<em> int goodsSold = in.nextInt();</em>
<em> int bonus =0;</em>
<em> if(goodsSold>500000){</em>
<em> bonus=10000;</em>
<em> }</em>
<em> System.out.println("You bonus for "+goodsSold+" is "+bonus);</em>
<em> }</em>
<em>}</em>
Answer:
Client server system, packets in the network and the discussion regarding two approaches have been done. See the attached pictures.
Explanation:
See attached pictures for explanation.