Answer to Question #21888 in Python for Chirag




 Problem: A theatre seating chart is implemented as a two-dimensional array of ticket prices, like this: 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 20 20 20 20 20 20 10 10 10 10 20 20 20 20 20 20 10 10 10 10 20 20 20 20 20 20 10 10 20 20 30 30 40 40 30 30 20 20 20 30 30 40 50 50 40 30 30 20 30 40 50 50 50 50 50 50 40 30 Write a program that prompts users to pick either a seat or a price. Mark sold seats by changing the price to 0. When a user specifies a seat, make sure it is available. When a user specifies a price, find any seat with that price starting at the front and working to the back of the theatre. Make sure you write your program using well defined functions  

Program this in python language
Unfortunately, your question requires a lot of work and cannot be done for free.   
Submit it with all requirements as an assignment to our control panel and we'll assist you.
Your explanation is not consistent. You state that the user is to enter a range as in "find me all numbers between x and y that are divisible by both 3 and 4." Later you state that you "input value 120 10 times". That is inconsistent with the problem so either the problem is stated incorrectly or you are not inputting the expected data. Decide what is the correct problem then write it up in pseudo-code before you write the actual code.


If a range is expected, make sure you test that it is a valid range (x <= y). ?answer :
step 1 of 1 :


in a pareto chart, the bars are always arranged in descending order according to frequencies.
the pareto chart helps us understand data by drawing attention to the more important categories, which have the highest frequencies. I will preface this by saying that I don't know Java at all. I touched upon it in school 20+ years ago, but I've been doing PHP ever since.


However, on line 27, you say that if the input passed in is a double, execute this code block *blah*.


The user enters -1.


Is -1 not a double? It is a valid double, and therefore the code block executes, setting the priceFromUser to be -1 and adding it to the list.


Then, when the loop starts back up again on line 23, priceFromUser is now -1, so the loop breaks and prints the tally.


Also, note you're definining this constant SENTINEL variable, but you're not actually using it anywhere in your code.


Perhaps do something like this instead, changing the while loop into a do-while loop:



```
System.out.println("Please enter item price to start, since there needs to be at least 1 item:");

do
{

        // Keep asking for a price until the user enters a valid price
        while (!in.hasNextDouble())               
        {
                trash=in.nextLine(); //throw away the input 
                System.out.println("You did not enter a valid price. Please try again:");
        }

        priceFromUser=in.nextDouble(); //read value from user
        list.add(priceFromUser); //add valid price to the list            

          System.out.println("Please enter another item price, or enter -1 to quit.");

} while (priceFromUser != SENTINEL)
```

Note this isn't valid code because I'm not a Java programmer, but hopefully it helps you out a bit. Well.



Think about what you know about lifts.



Go with the theory of 2 lifts, one you have more than 1 lift the logic is the same you just have more options.



Lifts go 1 of 2 ways. up or down.  

A lift at floor 1 told to go up, if someone rings the bell on 3 and the lift is going there or passing there on the way up and the person said "up" on 3.. then it will stop, otherwise if its not due to stop there and the person said down, it wont. The other lift will get the job, or if both are going up, then it will be the first available lift.



Your lift needs states waiting/up/down



Your logic shouldnt be that complex, so, write down in words what your logic choices are, senarios etc



Then you should be ready to code it direction: a word and number arrangement machine when given an input line of word and numbers rearranges them following a particular rule in each step. the following is an illustration of input and rearrangement. input: politics 61 policy 116 partner 93 role 45 clear 27 38 point step i: role politics policy 116 partner 93 45 clear 27 38 point 61 step ii: role clear politics policy partner 93 45 27 38 point 116 61 step iii: role clear partner politics policy 93 45 38 point 27 116 61 step iv: role clear partner politics policy 93 38 point 45 27 116 61 step v: role clear partner politics point policy 93 38 45 27 116 61 step v, is the last step of the above arrangement as the intended arrangement is obtained. as per the rule followed in the given steps find out the appropriate steps for the given input. input: energy 54 78 place 23 issue 211 145 flat rent taxi 17in step iii, what is the difference between fifth element from left and second element from right? The problem is that your pair's closure must return two different types of objects: int if you ask for "con", and the next closure on the line if you ask for "crd".


Here's one possible implementation:


Use a speaker so you can come back.



```
public static Func<string, dynamic> Pair(int x, Func<string, dynamic> y)
{
    Func<string, dynamic> pair =
           (a) =>
           {
               if (a == "con") return x;
               if (a == "crd") return y;
               throw new Exception();
           };

    return pair;
}

public static void Print(Func<string, dynamic> pair)
{
    while (true)
    {
        var next = pair("crd");
        Console.WriteLine((next == null ? "-":"+") +"> " + pair("con"));
        if (next != null)
        {
            Console.WriteLine("|");
            pair = (x) => next(x);
            continue;
        }
        break;
    }
}

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```


  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

Test:



```
var pair = Pair(1,
            Pair(2,
                  Pair(3,
                        Pair(4, null))));

Print(pair);

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```

output:



```
+> 1
|
+> 2
|
+> 3
|
-> 4

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
``` hi kevin, thank you for sending your question the the disney parks moms panel. congratulations on securing a reservation for cinderella's royal table, it can be difficult to find a reservation! if you choose to use your disney dining plan at cinderella's royal table, all you need to do is tell the cast member when you receive your cheque and he/she will credit the full amount to the credit card that you used to secure the reservation. this happens quite a lot, since cinderella's royal table needs to be paid in full in order to secure your reservation, the cast member will quickly adjust your cheque and process your dining plan credits. i would recommend keeping an eye on your credit card statement just in case, payment may take several days to process. please keep in mind that cinderella's royal table requires two dining plan credits per person, and gratuities are included. personally, what i like to do is pay out of pocket for our meal at cinderella's royal table and use the extra credits for another meal during our stay. since we make advanced dining reservations 180 days in advance, upon our arrival i don't even notice the charge, and i can enjoy some other table-service dining locations during our visit. i hope you have a magical visit at cinderella's royal table, kevin. please let us know if you have any other questions, we are always happy to help. stephanie send me a message and i'll see what we can do for you.
 


  
 


 be sure to include a description of the issue, your username, and the error message you are prompted with when you attempt to create a ticket.
 


  
 


 received your message. topic locked. seat 重新考慮這個當面臨特別產品公司的管理時的問題（像在第1.2 部分裡提出的那樣）
在一個更詳細的調查下，請在現在對此問題的數據提供更好的估計。 

限定出版(或限量生產)的老式落地座鐘它的期初生產費用（此為固定成本）仍然被估計為50000 美元，但是對邊際成本的新估價是500 美元。 估計現在出售的每台老式落地座鐘的收入是700 美元。

ａ.請使用圖解的程序來發現新的收支相抵點。 

ｂ.請使用代數的程序(數學的方式)來發現新收支相抵點。
 
ｃ. 請說明此問題在使用新數據之後的數學模型。 

ｄ. 在銷售預測為300下（不過我不知道這裡是講銷售量還是指金額>"<），把這個數學模型編入一張電腦表格。使用這個電子表格模型發現新收支相抵點，並且確定以此模型所得出的生產數量以及估計的總利潤。

ｅ. 假設經理害怕此銷售預測可能過度樂觀，因此不想要考慮生產超過200台老式落地座鐘。使用電子表格來決定生產數量應該為多少，並且估計可能將產生的總利潤。