Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

write a program to print W pattern of n lines using an asterisk charecter (*)

Given a weighted undirected tree of N nodes and Q queries. Each query contains an integer D. For each query, find the number of paths in the given tree such that all the edges in the path




are divisible by D.




put Format:




First line contains two space separated integers, N and Q (1 ≤ N.Q < 10³), denoting number of nodes in the tree and number of queries. Next N 1 ine contains three space separated integer Y and W[1 < X,Y <N] (1< W< 10³), denoting that there is an edge between X and Y of weight W. Next Qlines contains one integer each, 0(1 <D≤ 10').

"""Q5: 

Create a Pivot Table that shows the median rating for each director, grouped by their respective countries. Name your variable

'pivot_agg'

"""


AssertionError: DataFrame are different

DataFrame shape mismatch
[left]:  (19, 117)
[right]: (125, 1)





b.

c. d.


1 2 3 4 5 6 7 8 9 10 11

Fill the array with random numbers between 10 and 90 Calculate and print out the sum of the elements in such manner:

- If the element is even divided by 2

- If the element is odd multiply it with 2

Display the array elements in reverse order 4 numbers on each line Create another array B of 12 integer numbers

Then copy the elements of A to B in such manner:

Write the odd numbers first then the even ones

A

 13

  25

  75

  35

  79

  50

  60

  90

  80

  40

  10

  90


An integer number is said to be a perfect number if its factors, including 1 (but not the number itself), sum to the number. For example, 6 is a perfect number, because 6 = 1 + 2 + 3. Write a method perfect that determines whether parameter number is a perfect number. Use this method in an application that determines and displays all the perfect numbers between 1 and 1000. Display the factors of each perfect number to confirm that the number is indeed perfect.


Write a method multiple() that determines, for a pair of integers, whether the second integer is a multiple of the first. The method should take two integer arguments and return true if the second is a multiple of the first and false otherwise. [Hint: Use the remainder operator “Modulo”.] Incorporate this method into an application main() that inputs a series of pairs of integers (one pair at a time) and determines whether the second value in each pair is a multiple of the first.


A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time.

Write an application that calculates and displays the parking charges for each customer who parked in the garage yesterday. You should enter the hours parked for each customer.

The program should display the charge for the current customer and should calculate and display the running total of yesterday’s receipts. The program should use the method calculateCharges() to determine the charge for each customer.


Write a function NumRepeats(num1,num2,num3) that takes 3 integers as arguments, and returns the number of items that are repeated.

Example:

NumRepeats( 5, 9, 4) will return 0

NumRepeats( 5, 9, 5) will return 1

NumRepeats( 5, 5, 5) will return 2


Write a method whatSeason(month, day) that prints out the season according to the month and day.

The month is a integer that is one of the months - like 1 to 12.

The day is an integer that is a legal day of the month - like 1 to 31.

You may assume that the month and day are “legal” values.

Winter is from 12/21 to 3/19 Spring is from 3/20 to 6/20 Summer is from 6/21 to 9/22 Fall is from 9/23 to 12/20

It should print out one of these four messages:

It is spring.
It is summer.
It is fall.
It is winter.

size1 and size2 are the sizes of two files, and space is the amount of available space on a flash drive. Write a function that takes these integer numbers as arguments and figures out the largest combination of files that fits on a flash drive. The method should return 3 if both files fit together, the file number (1 or 2) corresponding to the longest file that fits by itself (1 if the files are the same size), or 0 if neither file fits on the flash drive.

Your function must have only one return statement