<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248441</link>
    <title>MATLAB Central Newsreader - Please help me to slove this problem!!!!</title>
    <description>Feed for thread: Please help me to slove this problem!!!!</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 06 Apr 2009 08:07:02 -0400</pubDate>
      <title>Please help me to slove this problem!!!!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248441#640602</link>
      <author>Ijat </author>
      <description>Question&lt;br&gt;
A small bus company has just purchased a computer for its new automated reservations system.The owner of the company has asked you to program the new system.You are to write a program to assign seats on each bus with capacity of 40 seats.You program should display the following menu of alternatives.&lt;br&gt;
&lt;br&gt;
Please type 1 for &amp;#8220;VIP seat&amp;#8221;&lt;br&gt;
Please type 2 for &amp;#8220;economy seat&amp;#8217;&lt;br&gt;
&lt;br&gt;
If the person types 1,then your program should assign a VIP seat section (seat 1-26).If the person types 2,then your program should assign a seat in the economy section(seat 27-40).Your program should then print a ticket including the passenger seat class and the seat number on the same ticket.&lt;br&gt;
&lt;br&gt;
Use a single-subscripted array to represent the seating chart of the bus.Initialize all the elements of the array to 0 to indicate that all seats are empty.As each seat is assigned,set the corresponding elements of the array to 1 indicate that the seat is no longer available.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Your program should never assign a seat that has already been assigned.Your program also has to show the message &amp;#8220;VIP seat SOLD OUT&amp;#8221; if seat in VIP class is full and the message &amp;#8220;economy seat SOLD OUT&amp;#8221; if seat in economy class is full.&lt;br&gt;
&lt;br&gt;
My answer is :&lt;br&gt;
x=input ('Enter your seat : ');&lt;br&gt;
if x==1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp('VIP seat');&lt;br&gt;
else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp ('Economy seat');&lt;br&gt;
end&lt;br&gt;
x=input ('Select Your Seat:');&lt;br&gt;
if x&amp;lt;0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp ('number you enter invalid');&lt;br&gt;
elseif x&amp;lt;27&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp('VIP Seat');&lt;br&gt;
elseif x&amp;lt;40&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp('Economy Seat');&lt;br&gt;
else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp('number you enter invalid');&lt;br&gt;
end&lt;br&gt;
x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];&lt;br&gt;
end&lt;br&gt;
y=[0,2,3,0,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,20,21,22,0,24,0,26];&lt;br&gt;
a=(x~=y)&lt;br&gt;
x=[27,28,29,30,31,32,33,34,35,36,37,38,39,40];&lt;br&gt;
l=[27,28,29,0,0,0,0,0,0,0,0,0,39,40];&lt;br&gt;
b=(x~=l)&lt;br&gt;
x=input ('Select Your Seat:');&lt;br&gt;
if x&amp;lt;0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp ('number you enter invalid');&lt;br&gt;
elseif x==1,4,7,8,9,10,11,12,13,14,15,16,17,18,19,23,25&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp('VIP seat is SOLD OUT');&lt;br&gt;
elseif x==30,31,32,33,34,35,36,37,38&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp('Economy seat is SOLD OUT');&lt;br&gt;
elseif x==2,3,20,21,22,24,26,27,28,29,39,40&lt;br&gt;
else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;disp('number you enter invalid');&lt;br&gt;
end&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
Please give me the right command..!!!&lt;br&gt;
Help me!!&lt;br&gt;
please...&lt;br&gt;
It's between the life and death!!!&lt;br&gt;
we will dismiss!!!</description>
    </item>
    <item>
      <pubDate>Mon, 06 Apr 2009 08:26:01 -0400</pubDate>
      <title>Re: Please help me to slove this problem!!!!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248441#640607</link>
      <author>Gavrilo Bozovic</author>
      <description>&quot;Ijat &quot; &amp;lt;darkness_roses90@yahoo.com&amp;gt; wrote in message &amp;lt;grcd75$q9k$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Question&lt;br&gt;
&amp;gt; A small bus company has just purchased a computer for its new automated reservations system.The owner of the company has asked you to program the new system.You are to write a program to assign seats on each bus with capacity of 40 seats.You program should display the following menu of alternatives.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Please type 1 for &amp;#8220;VIP seat&amp;#8221;&lt;br&gt;
&amp;gt; Please type 2 for &amp;#8220;economy seat&amp;#8217;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If the person types 1,then your program should assign a VIP seat section (seat 1-26).If the person types 2,then your program should assign a seat in the economy section(seat 27-40).Your program should then print a ticket including the passenger seat class and the seat number on the same ticket.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Use a single-subscripted array to represent the seating chart of the bus.Initialize all the elements of the array to 0 to indicate that all seats are empty.As each seat is assigned,set the corresponding elements of the array to 1 indicate that the seat is no longer available.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Your program should never assign a seat that has already been assigned.Your program also has to show the message &amp;#8220;VIP seat SOLD OUT&amp;#8221; if seat in VIP class is full and the message &amp;#8220;economy seat SOLD OUT&amp;#8221; if seat in economy class is full.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; My answer is :&lt;br&gt;
&amp;gt; x=input ('Enter your seat : ');&lt;br&gt;
&amp;gt; if x==1&lt;br&gt;
&amp;gt;     disp('VIP seat');&lt;br&gt;
&amp;gt; else&lt;br&gt;
&amp;gt;     disp ('Economy seat');&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; x=input ('Select Your Seat:');&lt;br&gt;
&amp;gt; if x&amp;lt;0&lt;br&gt;
&amp;gt;     disp ('number you enter invalid');&lt;br&gt;
&amp;gt; elseif x&amp;lt;27&lt;br&gt;
&amp;gt;     disp('VIP Seat');&lt;br&gt;
&amp;gt; elseif x&amp;lt;40&lt;br&gt;
&amp;gt;     disp('Economy Seat');&lt;br&gt;
&amp;gt; else&lt;br&gt;
&amp;gt;     disp('number you enter invalid');&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; y=[0,2,3,0,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,20,21,22,0,24,0,26];&lt;br&gt;
&amp;gt; a=(x~=y)&lt;br&gt;
&amp;gt; x=[27,28,29,30,31,32,33,34,35,36,37,38,39,40];&lt;br&gt;
&amp;gt; l=[27,28,29,0,0,0,0,0,0,0,0,0,39,40];&lt;br&gt;
&amp;gt; b=(x~=l)&lt;br&gt;
&amp;gt; x=input ('Select Your Seat:');&lt;br&gt;
&amp;gt; if x&amp;lt;0&lt;br&gt;
&amp;gt;     disp ('number you enter invalid');&lt;br&gt;
&amp;gt; elseif x==1,4,7,8,9,10,11,12,13,14,15,16,17,18,19,23,25&lt;br&gt;
&amp;gt;     disp('VIP seat is SOLD OUT');&lt;br&gt;
&amp;gt; elseif x==30,31,32,33,34,35,36,37,38&lt;br&gt;
&amp;gt;     disp('Economy seat is SOLD OUT');&lt;br&gt;
&amp;gt; elseif x==2,3,20,21,22,24,26,27,28,29,39,40&lt;br&gt;
&amp;gt; else&lt;br&gt;
&amp;gt;     disp('number you enter invalid');&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt;    &lt;br&gt;
&amp;gt; Please give me the right command..!!!&lt;br&gt;
&amp;gt; Help me!!&lt;br&gt;
&amp;gt; please...&lt;br&gt;
&amp;gt; It's between the life and death!!!&lt;br&gt;
&amp;gt; we will dismiss!!!&lt;br&gt;
&lt;br&gt;
What is the problem you're having?&lt;br&gt;
&lt;br&gt;
No one will read carefuly the question, then read carefuly your code, and then do your homework for you.&lt;br&gt;
&lt;br&gt;
Come with a precise question, and you'll get a precise answer. Also, state clearly in the subject what your problem is.</description>
    </item>
  </channel>
</rss>

