Good morning. Today, we are going to discuss the mid-sem questions. I am sure by now you would have worked out the right solutions. As I had mentioned to you so many times, there is nothing like a unique answer in terms of writing a program for a problem. You could approach the problem and algorithm in multiple ways. What I am showing you are sample solutions. In some cases, we have worked out multiple alternatives, but I am sure many of you would have chosen still something else which is not visible. However, the TAs who evaluated the papers have gone through your answers and tried to understand the answers. The sad part of life for me is that even now, many of you are making very silly mistakes in writing syntax. Most of the answer books do not have proper comments. Most of the answers are still not using proper indentation. I have warned you that we will be deducting marks for those lapses. Unfortunately for us and perhaps fortunately for you, we have decided not to consider indentation and commenting while evaluating the questions or answers, but to do so in a moderation round at the end of entire correction work. Unfortunately, the correction work took much longer than what we thought. There was no time left for moderation. As a result, the possible negative marking has now been converted into the following. The lab TAs who will distribute your answer sheets back to you during your respective labs will be going through each paper for that lab batch and wherever they find that there is a reasonably good amount of documentation proper indenting, they will give bonus marks. Those bonus marks for some of you will get added. Bonus marks will be at most two of course. So it will be zero, one or two depending upon the qualitative nature of your responses. But please remember that you will soon be embarking on doing your projects and when you write programs for your projects, if you don't them write the first time correctly, you will generally not have time later to revisit them to include additional comments or to indent them properly and so on. There is something which you have to do right from the beginning correctly. Most of the questions except question four and perhaps to some extent the merging that was required within two portions of the array where there was no space to use the sentinel technique that we had used in the illustration here. All other questions were more or less similar to what you have been doing in the labs and earlier. And I was quite disappointed that people made mistakes even there. I will point out some of the observations that we have made while correcting the answer books. But first let me present some possible alternate solutions. So the first problem question one A was given a number M which has odd digits find out and prints the middle digit D. For the sake of completeness in this solution, I have assumed as is expected to be assumed that M has been read and validated. In some other alternate solutions on the slides here I have done input processing as well. But in questions which does not require you to do so, you could very well omit those portions. So here the approach that we take is first we find out the number of digits in M and after finding out the number of digits we try to extract the middle digit and output that. So here is one alternate solution which first finds the number of digits in M. I use a temporary variable in which I preserve the value of M. I start with some count arbitrarily at one and I keep dividing this time by 10. So for example, if my number temp 1 which is essentially M is say this at the beginning then let us see how through this iteration what will I get. Basically what I am trying to capture is the value of I which is essentially a power of 10. So I am trying to find out the number of digits here. So what I do is I keep dividing this by 10. Initially this is 1, 2, 3, 4, 5 for example I will be 1. The iteration that you see here while temp 1 greater than 9 essentially I am trying to check whether I am left with a single digit value. Greater than 9 will mean that I have a number which is 10 or more which is 2 digits or more digits. So I keep reducing it till it reduces to a single digit number that is the logic of this loop. So if you notice this iteration will the first iteration this will be divided by 10 reducing it to 1, 2, 3, 4 and I will increment as I plus plus to 2. In the next iteration this will reduce to 123 I will become 3. In the next iteration this will become 12 I will become 4. Observe that the number temp 1 is still greater than 9.  Notice that what we have done is by successively reducing this we have got value of I incrementing from 1, 2, 3, 4, 5 essentially we are counting digits. There are people who have used arrays for storing digits. It is not required although you could do so. However there are people who have completely neglected the stipulation that M has been read and they are reading individual digits of the number. So they are reading a 0 into some digits. They are actually asking for input how many digits the number has. Then say give me individual digits. Now if I tell you how many digits the number has and if I give you individual digits you do not require any brainstorming computation to figure out what the middle digit is. That is completely not in concerns with the spirit of the question. The question required you to look at a number. The number need not have been 5 digit, need not have been 3 digit, need not have been 7 digit. It could be any number. And therefore it is appropriate that you first try to figure out how many digits that number has and then determine what next you can do. So observe the output statement here which says the digits is R which is essentially 5. A good programmer will also check whether the number of digits is even or not. Why? Because if the number of digits is even then a middle digit is not correctly defined. I do not expect you to do that in an exam of this type. The first exam is the first course. But as good programmers you would automatically think of doing this. Now all these thinking should have happened before you start writing the program. And therefore I would have expected a comment here that I will first find the number of digits if they are R then I will proceed to find out the middle digit. Some single line, two line command would be useful. Next I proceed to determine the middle digit. I know the number of digits. The middle digit is to be extracted and since I know the value of I, I know that the middle digit will be at the position I by 2 plus 1. Since I is odd 5, 7, 9, I by 2 will be 1 less than the middle point and that plus 1 will be the position of the middle digit. So to get that we first evaluate temp 2 equal to 10 raise to power I by 2. So in this case when I is 5, I by 2 will be 2. 10 to the power 2 is 100. And if I divide the 5 digit number by 100, I will actually get the middle digit at the end. Then we divide temp 1 by temp 2 to get the middle digit in the last position. So I find the power of 10 and I divide the number by the, to get the last position at the middle digit and then extract it using modulo 10. The problem could actually be solved in a much simpler fashion, but this is just one alternate way I am showing that if you wanted to proceed in this manner, first counting the number of digits, then finding out up to what point you should reduce that to get the final digit that is perfectly fine. So here for example, if I put temp 2 and j, initially I start with temp 2 as 1. In the iteration j is set to 0, temp 2 is incremented by multiplying it by 10. So I get 10 here. I continue with the iteration, j becomes 1. 1 is still less than I by 2. I by 2 is 2 because I was 5. I will once more multiply this by 10, getting 100. At this time, j will become 2. Since j now is no more, is actually not less than I by 2, this iteration will terminate here because j less than I by 2 is the condition up to which the iteration can continue. Since 2 is not less than 2, this condition is false and therefore I will come out. Observe that when I come out, I have got actually this which is 10 to the power i by 2. Now when I come out of this loop and I come out here, I calculate now temp 1 as equal to original m which is 1, 2, 3, 4, 5 divided by 100 and I get 1, 2, 3. All that I have done by doing this funny logic is I have got the middle digit in the last position of a number. Please note that it does not matter whether this is the only one digit number, three digit number, five digit number or 21 digit number. I simply take the modulo 10 of this number and I will get k is equal to 3, which I out. So this was a simple problem and there is absolutely absolutely no reason why every one of you should not have got the correct answer. Unfortunately, some of you haven't worked it out properly. Here is an alternate method of doing it. This attempts to find out the digit in a single iteration. So observe what it does. It takes the value of m as temp 1, k is equal to 1 and it evaluates k as the modulo 10 of temp 1 that is remainder of temp 1. So let us just do exactly what we did earlier. Our m which is essentially temp 1 and our k, initially temp 1 is m. In our example, we have taken it as 1, 2, 3, 4, 5, k is initially 1. Immediately after assigning 1 to k, I am reducing k to 1 percent 10, which means I will get this as 5. So observe a silly error here. This is all deliberately put. This is we have tried to process into the shoes of students who might think of this logic. Because of our penchan for initializing every variable, somebody might initialize k equal to 1. Notice it is not required because k is immediately being given another value, which is a proper value, which is the last digit of temp 1. So k will now have 1 will go out and 5 will come in its place and there is another one called temp 2, which is set to temp 1 by 10. So I get 1, 2, 3, 4. So what we are doing is actually we are taking this number, extracting the last digit of this number and putting it in k and the remainder of the number we are putting it in temp 2. Now let us see what we do inside this loop. Why temp 1 divided by 100 not equal to 0. What is temp 1 divided by 100? How much is this in the first case? 123. Is it equal to 0? No. So I will actually get inside the iteration and inside the iteration I will calculate k as temp 2 modulo 10. So k becomes temp 2 modulo 10, which means this becomes 4 now and temp 2 itself is divided by 10. So temp 2 now becomes 123. Notice I actually have got k as temp 2 divided by 10 as 4 and 1, 2, 3 here. Now I am doing another interesting thing. I am dividing temp 1 by 100. When I divide temp 1 by 100, what do I get? 1. So notice the logic that is being followed. Since I am supposed to find the middle digit and since I have odd number of digits, if I keep dividing the number by 100, 100, 100, I will approach that middle digit. So for example, first time it was 12345, next time it is 123, next time it is 1. So I am reducing that number by factors of 100. I go back to this iteration again. Temp 1 by 100 is still not equal to 0 because I have 1 here. That means I will go through this iteration exactly once more. k will be calculated as temp 2 modulo 10. So this will be calculated as 12, sorry, this will be calculated as 3 and temp 2 will be calculated as temp 2 by 10, which will become 12. I divide temp 1 again by 100, getting 0 this time. So it is very interesting logic. I am dividing temp 1 by 100 every time, but I am dividing temp 2 by 10 every time and I am extracting the so-called last digit from temp 1 here. So I got, sorry, temp 2, original temp 2 would have been 12345. So I get 543 and I stop my iteration after I approach the middle digit. So I can do n number of different ways of finding it out. Ultimately I know that when I get out of this iteration, the value of k is the middle digit and that is what I print. Again, this is another logic, not necessarily the best logic. I will leave it to all of you to work out the most elegant program. In fact, my colleague Prasar Houthi is going to announce a programming contest where you will have chance of proving yourself or an extended period of time, not under timed conditions of an examination. This question was another giveaway. We had solved many such problems at the beginning. We had looked at flow charts. All that this question asked is that if x is less than 0 and y is greater than 0, then z is equal to y minus x. If x is less than 0 and y less than equal to 0, then z is equal to this, etcetera. There are four conditions. If you look at this carefully and many of you have done that, you have figured out that the given logic adds absolute values of the given numbers. So absolute value of x plus absolute value of y is z, independent of any conditions. However, if you want to implement these conditions as they are stated using the conventional conditional execution logic of c, c, c plus plus, I start by reading the values of x and y which is not required as far as the exam was concerned because these were supposed to have been read. But look at this alternative solution one. This depicts exactly the complex logic using if then as. Say if x is less than 0, then if y is greater than 0, z is y minus x. If y is less than equal to 0, z is minus y minus x. This if condition closes and immediately this is followed by an else condition. Now this is a slightly lengthy program because the number of lines of code that you write or more although you do not write much in every line. But this is the cleanest representation of the logic that you have here. You could therefore do this. The problem did expect you to write an output statement and that is something amazing I find. We had specifically stated in the question paper that you do not need to write input. You can assume valid input to be present in the variables and arrays. However, the output statements must be present. So, there are students who have just written c out z. c out z will give you a value on your terminal when you execute that program and that could very well be value of x, y or p or q or anything. How many times we have emphasized that no output should be produced unless it is accompanied by an appropriate message saying this output is this, this, this. One of my colleagues pointed out that because I am giving you a lot of ready made programs in every lab, you are tempted to cut and paste those programs and therefore you rarely write individual lines by your hand on paper. In fact, you rarely type individual lines on the terminal as well. Now, that is probably causing this problem. It is important that you write programs by hand. It is important that you write those statements by typing them on the machine, the smaller ones. If you do not do the smaller ones, while writing the bigger programs you will be tempted to take shortcuts. That is something that needs to be avoided. Anyway, this logic can be further simplified in terms of the length of the program by simply putting your if statements like this. Exactly the same if statements. Here we observe that what you are executing after every condition checking or in the else part is a single statement. A single statement need not require braces. So, curly brackets are not required if you have a single statement. However, the logic is not as obvious as it should be unless you actually put this else indented along with this if and this else indented along with this if and the third else indented along with this if. Please note that as per a C++ compiler is concerned, I could have written all of this in a single line and that will still be a valid program.  So, I will tell you this last time. You write programs correctly not only so that the computer can compile and correctly execute those programs, but you write programs such that those programs can be read and understood by other human readers. It is as important as writing correct programs. No less. Here is a third alternative way of solving this problem. I do not want to exercise my mind to see what are the possible combinations of if then else. Somebody has prescribed that the value of z should be calculated. This is perfectly correct solution. Absolutely nothing wrong with it. I am writing every condition explicitly. If x is less than zero and y greater than zero z is equal to y minus x. If x is less than zero and y less than equal to zero z is equal to minus y minus x. Perhaps the program is less elegant, but it is correct. It will work correct. The other problem with this program is even though the first condition is true and said evaluates to this, you will end up evaluating all the remaining three conditions because that is what the program stipulates. So, you can say it is slightly less efficient, but since correctness is more important, the program is corrected. Unfortunately, even here, people have made mistakes. For example, there are some people who are still writing a single ampersand here. Single ampersand as a logical and is a mathematical notation not C plus plus syntax. So, and and or logical and and logical or how to be and and and vertical bar, vertical bar. No other notation is permitted. So, please remember to use the correct syntax. Again, you have to output whatever the solution that you get. Here is a fourth alternative solution. As I told you, if you read the conditions carefully, you figure out that z is equal to absolute value of x plus absolute value of y. In which case, you can say you have to write this though. You have to say that I can use the standard library function absolute, but this solution requires use of standard mass library and therefore, we must include the following at the beginning of the program. This must be written as part of the command even though you are writing a portion of the code. Without this command, this code is invalid the way the program is given. Please remember you are supposed to write programs to replace those dashed lines. So, the rest of the program is as type. If you require any additional variables, you are required to declare them. If you require any additional inclusion of this kind at the beginning of the program, you are required to state that. If this was the only error, I would have been happy. Unfortunately, people have taken liberties to write z is equal to. Please understand that the semicolon will figure out what semicolon is. The c plus plus compiler figure out plus symbol equal symbol z. It can't figure out this. A very wise compiler may possibly say that one vertical bar from the or symbol is missing, but this does not make sense. So, please remember to use the proper syntax of the programming language that you use. If you are programming in Java, probably similar symbolism or syntax will be there, but if you are programming in Pascal or Algol or Fortran, you'll have to use different syntax. And as I told you right very early, by the time you graduate and go out, there will be 10 new programming languages which you may be required to use. The programming concepts will still remain exactly same at fundamental level. You must therefore be able to quickly map your understanding of this syntax into whatever syntax is available and correctly use it. That is required. Here is another question which I thought was pretty simple. We had worked out how to find out the maximum number given n numbers. This problem said that there are n numbers which are available as n elements of an array A. And you have to find out the second maximum, the second largest. This problem again can be solved in multiple ways. I have written here for the sake of completeness, a whole lot of comments. Please note that you were not required to do any one of these because all of this was stated to be assumed. You could have assumed that n numbers have been read into 0 to n minus 1 elements of array A. So, all this can be assumed. But just for the sake of completeness, if you were to write a program fully, I would expect you to write all of this, including those hash include and using namespace, STD and so on. This is to illustrate the notion of proper input and validation. So, for example, since n is constrained to be within the size of A, value of n cannot be greater than 10. Why it should not be less than 2? Because if I am finding out the second largest element, there have to be at least two elements. This particular program in the alternative solution 1 uses this example 5, 7, 24, 18, 72, 71 as values. We have gone through this umpteen time, but let me quickly go through this to find out how this logic will work. So, what is this logic? Now, this is what is important. Whatever logic you use, you are expected to write a command. Majority of the students while solving this simple problem have not written a single line of command. That is incorrect. Actually, you should have been given straight away zero marks for that question. We have not done so just because this is the kind of exam environment that you have. But please remember, if you don't write commands in exams, you will not write them while you are writing program. That's a habit that you have to pick up. So, look at these commands. The commands could have been written in different ways, in different styles, and of course, must reflect the logic that you use. Here, what we are saying is that we are using temp1 to store the largest and temp2 to store the second largest value at any stage of our array square. We are implying thereby that we will be having a iteration which will scan the entire array element by element. And in doing so, we will maintain two temporary variables, one holding the maximum value, one holding the second largest value. We start with the assumption that 0th and 1st elements are largest and second largest. If these are not in that order, we swap these. So, temp1 is a0, temp2 is a1, arbitrary assignment as we do for finding out maximum. And then, I check whether a1 is greater than a0. In this particular case, 7 is greater than 5. So, what will happen is, if I take temp1 and temp2, initially, I will have temp1 as a0, which is 5, and temp2 as 7. When I execute this condition evaluation, a1 will be found greater than temp1, and therefore, I will push this element a1, which is 7, to temp1, and element a0, which is 5, to temp2. I could have swapped these using a temporary variable, but it is not required, because I have a0 and a1 available to me anyway. The next part is scanning the array. So, look at the command, which says we examine the array from second element onward. If that element is larger than temp1, we move temp1 to temp2 and assign that element, which is now the largest to temp1. However, if that is not so, we compare the new element with temp2 and change temp to it lesser. So, let us look at again the same logic. I have started with temp1 and temp2 from my previous slide. These values are 7 and 5 respectively. So, please note that at any stage I am holding, the largest value is temp1 and the second largest in temp2. This iteration goes from i equal to 2 to less than n, which means it will examine 24, 18, 72 and 71, because this is 0th element, 1st element, 2nd, 3rd, 4th and 5th. So, what happens when I do that? I examine, let me just write down that i is equal to 2 here. So, I am examining 24th element. I compare whether 24 is greater than temp1. Yes, it is. If it is, what do I do? I push temp1 into temp2. So, this goes here, 5 is removed and the new element 24 comes in temp1. So, again true to what we said, true to what we said, we retain the largest value under temp1 and the second largest value under temp2. We go to the next element now, because i becomes now 3. I check 18. Is 18 greater than temp1? It is not. Since it is not, I come to the else part. Is it greater than temp2? It is. So, I replace 7 by 18. So, again I am maintaining the largest value here, smallest value here. Next I look at 72. Is it greater than temp1? Yes. So, I push this 24 here, removing 18 and I get here 72. So, again 72 and 24. Up to whatever point I have examined, I always maintain maximum here, second maximum here. The last element is 71. Is 71 greater than 72? No. So, the first condition does not apply. I come to else. Is it greater than temp2? Yes. 71 is greater than 24. So, I remove this and replace it by 71. At the end of this, the second maximum element will always be found in temp2, as we have seen that. Now, this is one way of doing things. You could use a single variable. Here is another approach which uses a single variable D to hold the second maximum. It starts with D equal to a0 and for i equal to 1 to n minus 1, it keeps comparing D with ai. If D is less than ai, then max2 is set to D and D is set to ai. So, it will continue glancing through that. Any number which is less than the scan number up to so far will be put in D. Almost like the previous algorithm, D will track the second largest. You will notice that in this particular case, by the time you come here, this would have been maximum. 24 would have been maximum and 18 would have been second maximum. When you come to 72, 72 would be largest and 24 will become D. Even if this is 72, D will still remain 24. So, this particular algorithm has the possibility of working out the second maximum even though if you have a series of maximum numbers, that is your 72, 72, 72, 72 and just one number which is all. The problem with this particular thing is that if all numbers are same, the entire array has only 72, 72, 72, then technically there is no second maximum. Each digit, each number is maximum. Observe what happens in this case. I am arbitrarily saying D is equal to a0 and then coming out with this iteration and then saying second maximum in the array is max2. If D which is a0 is equal to all other elements, this condition will never be satisfied and therefore you will never look at this max2 assignment at all. This assignment statement will not be executed. What will be printed then?  So, this is the danger. That is the reason why you must actually execute algorithms by hand and do the needful. Here is another alternate solution 3. I have not worked this out, but this works on a simple principle that I sought the array. Sorting the array to find out second maximum is a costly way of finding out second maximum. The other approaches were on a single scan of the array. We know that when we want to sort the array, we require two scans. So, an outer iteration and then an inner iteration to sort the entire array. But that is okay. That is a correct approach still. If you have sorted the array in descending order, a0 will be largest, so you pick up the next element a1. Many students have taken this approach. However, this approach again suffers from the same problem that if the two elements are same and they are largest, then both a0 and a1 will contain the same value and a1 will not be the second largest. There is at least one student who has taken care of checking this. So, that student checks whether the next element is same as this and then the student skips successive elements till the student finds the second largest. His solution also does not presume that all elements could be equal. So, at the end, there is some haziness. However, this is just to emphasize that even in the simplest of the problems and the most straightforward of the logic, you might actually find squeakles of this card. And this you have to be very attentive to when you solve larger problems of which such logic is a smaller but important part. This was another straightforward problem. In fact, many of my colleagues are angry with me for giving such simple problems because we had discussed the null terminated string very well. A character C was given. It is assumed to have been read. An array has been defined as str, which is character 40. That means it can hold 40 characters string. Since in a 40 character string, you can have only 39 valid characters if the string has to be null terminated. So, you cannot have the actual string length greater than 39, which means the number of elements which will occupy a given character replicated will be 0 to 38. So, we are checking whether q is greater than 38 or q is less than 0. Otherwise, we are saying the number is invalid. However, you are not required to do any one of these things for question one at least. Why I am writing this is for two reasons. One is for the sake of completeness and other to emphasize that it does not is not a bad idea even in an exam to automatically do these things because these things should be ingrained in your mind such kind of validations of input. The logic is exactly a two line logic. I set up an iteration for i equal to 0 to q minus 1 because the q times I have to repeat a character and I assign the character C to ith element of str. Having filled up the q elements of array by this character, I just put up a backslash 0 in the last element which is the qth element. So from 0 to q minus 1, I replicate C and then I assign backslash 0 to q. I do not think the amount of marks given for this problem are justified and yet I was very sadly surprised that many people have not got this answer correct. There is somebody who has written it was not the character C which was supposed to be assigned. There is a care variable in which a value is supposed to have been read. The care variable could contain a star, question mark, d, z, anything and that character was supposed to be replicated. Somebody has said is completely incorrect. You cannot make an assignment of a simple variable to an array. A simple variable can be assigned to only one element of an array and you have to successfully assign it to various elements. So there are some of you who have perhaps not got the hand of distinction between array elements and the equivalence of array elements to simple variables which must be dealt with appropriately. I would strongly recommend you go back to basics, read some more examples and do some hand coding. Here is an alternate solution. It is alternate only in the sense that it shows two ways of printing it. Either I can print individual characters or I can print directly by saying c out str. Both are valid. In one case I must terminate before the end of string. Since I know in this case the length of string because that is stipulated it is easy. But otherwise as we examine in the class in some examples you have to look for the backslash 0 which is the null character and stop printing before that. If you print character by character. However you can also print the string. Question two required you to write a complete program. You had all done lab assignments on writing functions, passing parameters to function. This was a simple problem. You were expected to take a number and calculate an appropriate check digit for that number as per given logic. The logic was very simple. Take the number. Find out the sum of all its digits. Then take a modulo 10 of that sum because check digit can only be one digit. So if the sum comes 25 modulo 25 modulo 10 is 5 and 5 becomes the check digit. This is by the way very often used in practice. So you will find book numbers which are ISBN numbers. They are actually a more stringent checking logic. The idea is that given a large number such as your such number as a part number people could make that num. Somebody may type one digit wrongly or write one digit wrongly. A single digit error is always caught by the check digit. So if you have a seven digit number which you are writing. If you make a mistake it can't be caught. But if you have a eighth take check digit attached to it and you write that eight digit string. If one of these digits is wrong whenever you recalculate the check digit. The check digit will not match the one which you have entered. You may make a mistake in entering the check digit itself in which case it will still be invalid. So you can check the validity by using this logic. That is why this is a common less problem. Coming back to programming. The programming was supposed to be more straightforward. Look at what we are doing. The name calculate underscore check underscore digit. Since you are going to do your project work now which has as much weightage as 35 marks almost twice as much as miss M. You will be expected to write professional grade programs. Which means function names such as F, G, P will not be valid. Function names have to be meaningful. This is just one example that it should clearly indicate to you what you are trying to do. This function calculates check digit for a given number. So N which is given is a parameter. I am declaring all variables that I might internally require. This is necessary because the function does not take any definitions from the main program. So here I am declaring D, I is an index variable and CD is the check digit which will be calculated. All that I need to do is I need to reduce this N by dividing it by 10 and by extracting the last digit. Exactly the same logic that we did while looking at a larger number F. Some people have tried to use an array which is perfectly fine but you do not need an array because you do not need to retain the individual digits of the number for any other purpose. You have to sum them up. So you can start with sum is equal to 0 which is initialized here and this iteration will successively extract one digit of N. So let us say N is again 1, 2, 3, 4, 5 then D will first become 5, N will become 1, 2, 3, 4, sum will become 5. Next time D will become 4 because 1, 2, 3, 4 has 4 as the last digit, N will become 1, 2, 3 and sum will be 5 plus 4, 9 and so on. So it will accumulate that sum and once you get the sum you find out modulo 10 of sum which is the calculated check digit which you have to return. Again there is absolutely nothing fabulous in this logic. You have done these kind of problems earlier but I am surprised that several people got this solution wrong. There are people who have used arrays which is alright but they have used arrays in very funny fashion. Some people have used arrays here so they have said int a 10. So they are passing a 10 digit number as an array not 10 different numbers. This was clear to our evaluators when they looked at the main program where the main program reads still funnier. It says give the number of digits in the array. So I say 5 or 7 of whatever. Then give individual digits which they read in this individual array element. Then they pass this element laboriously to this function to calculate the sum. If you have to ask so much you could already ask give me the sum of all the digits or you could have said give me the check digit. That does not solve the purpose. Here in this question it was stipulated that you are given a number. If given a number you have to calculate the check digit for that number was the objective of this function. The main program had a slightly different objective. The main program was supposed to read an encoded number. That means a number which is already augmented by a check digit and you are supposed to confirm whether it is valid or not. So here we declare an encoded number as int. We declare a check digit. We declare an and we also have a variable called cd which is rhyming with the cd variable that we have used in the function. So obviously whatever that function returns I might use a similarly rhyming name there. That's the only purpose. I could have used any name. Look at what this program does. It actually reads a encoded number. If encoded number is less than equal to 9 it says invalid encoded number. Why? An encoded number cannot be a single digit number. If there is a single digit number for any coding that you are using say 5 or 7 it must be replicated. The sum of one digit number is the number itself. It's modulo 10 is that digit itself. So 7 when encoded will become 7, 7. So you can't have a single digit encoded number. You would be expected to keep this in mind and check whether somebody is giving you a wrong encoded number. After having raised this encoded number what do you do? This is what you are supposed to do. You separate out the check digit from the encoded number. Whether it is right or wrong you do not know but separation is very simple. You take modulo 10, you extract the check digit in some variable here. For the sake of completeness we are producing the check digit to be such and such thing. Now I have an encoded number and the check digit but I need to calculate what should be the correct take digit for which purpose I require the original number which I get by dividing the encoded number by 10. So please remember whenever you are handling numbers and whenever you want to deal with reduction of numbers or extracting digits, division by 10 and modulo 10 are the common sense operations that should occur to you automatically. A division by 10 will give you the number minus the last digit. This number you are supposed to pass on as a parameter to the function. So you say calculate check digit, original number and whatever the function returns you will put it in CD. Now obviously if the original given encoded number is valid, this CD should match whatever check digit you have extracted. If it does not match the number is invalid and that is what is done here. There are some people who have found this correctly but what they do is they do not print the thing correctly. It is not adequate to say check digit is this. This check digit you are referring to is one which was given along with the encoded number or one which you have calculated for the original. The correct output expected from this program because this program says validate whether the input encoded number is correct or not. You have to announce a judgment. Is the given encoded number valid or invalid and that can be done only by writing in if statement. If the two check digits match your output that given number is valid. Otherwise you say check digit should be so and so and the number is invalid. Even if you don't give the actual check digit it is okay but you have to say that it is invalid. So as I said people are passing on parameters and in fact there is one example which was mind boggling. This function let me just write this function as f. He is reading the array so the number which is assumed to be a large number is read in arrays d0, d1, d2, d3, d4, d5, etc. and instead of passing the array what is being attempted to pass to this function is d0, d1, d2 and after some time the student has given up and he has written etc. Now etc. is invalid parameter. C++ does not understand it. So for God's sake have some mercy on the compiler. The compiler is still not capable of understanding plain English language and it is certainly not intelligent enough to figure this out. Jokes apart I think it is absolutely essential for you to understand when not to use arrays and simple variables will do. Array should be used only when you need to retain the individual identity of elements such as in the question on images but we will come to that in a short while. Again this program was a giveaway. This question 3 again did not require you to write a full program question 2 dead and in question 2 you should have therefore ensured that you have written and put output statements properly, include statement properly at the beginning, written zero, closing blast etc. Some people have not done that possibly because the hangover of question 1 which did not require you to do that so you carried on to the next question. This problem I have just reproduced whatever it was. We have discussed this problem. We have discussed the problem how to sort an array. So given an array T1 how to solve that. We have also discussed the problem that if T1 and T2 are two sorted arrays how to merge them to get a single sorted array. Technically you looked at that solution and constructed a correct solution. Sadly many people miss the fact that when you have a single array then in a single array there are certain constraints that you have to work with. Let us look at what is involved here. This is the doing you can observe. It is actually putting alternate marks into the top portion and the bottom portion. So I is varied from zero to n by 2 and there is another variable j which I am carrying on for j equal to n by 2 and I am incrementing both of them. So as I varies from 0, 1, 2, 3, 4, 5, j varies from n by 2, n by 2 plus 1, n by 2 plus 2, etcetera up to n minus. And I am just assigning different values here. The data is artificially generated anyway. We have seen this problem in the class where we are generating data for marks and roll numbers and we are sorting those arrays. We had one array which we are sorting. Here we have two arrays within the same physical array. The way to sort this is very straightforward where even I have given you that this is where you should whatever you write will appear here. And what is the difference between this sorting algorithm and the one which was actually discussed in the class. The only difference is this should terminate at k less than n by 2. The array needs to be sorted only first half separately. After doing this you will get the array sorted. The question then said proceed to sort the second part. Again the only difference between this and the previous part is the starting point is now n by 2 and not 0. But it's the same. So either you don't read your class notes themselves properly or you can't map a solution into this strategy. There is at least one person I know who has read the class notes very carefully. In fact the student probably had access to the class notes because he is not doing this n by 2. He is starting with k equal to 0 and in addition to the marks he is also exchanging roll numbers which are non-existent here. They don't exist. Now when you are copying and pasting please don't copy non-existent elements at once. That is not good. Anyway the point that I am trying to make is the sample programs both in the labs and in the class handouts are useful for you to understand how exactly a certain logic is implemented. Beyond that they are not to be used. The tough part is the merging part. How do you merge the two parts of the array into top roll? Notice that in the class we have discussed the sentinel usage. A sentinel is a large negative value which cannot occur in the marks array and therefore can be written at the end of the array to signal that I have no more elements left to be considered there. Now when we discuss the problem in the class where two arrays t1 and t2 and we presume that there is an extra element available in which I could insert such a sentinel value. Unfortunately that liberty is not available in this problem. You will notice that the array size was prescribed as 1 lakh elements. You'll also notice that you might think for example that I might not be able to use sentinel for the top portion of the array because the next portion starts immediately thereafter. But I may use a sentinel element for the second half. Observe that the example given said number of students is one lakh. That means all the marks that have been generated will completely consume all the available elements in the array. The array has no space left. So you can't assume that the array has a space unless you say that I declare an array with 1,002 elements, 1,002 elements and I re-copy the generated data from 0 to n by 2 minus 1, the first half, copy that into this 1,00,002 element array, add a sentinel value there, then copy n by 2 plus 1,00,000 last element and copy a sentinel. That is too much of a work to be done. In any case nobody has done that kind of thing and yet people have assumed the sentinels to be present or inserted sentinel. If you insert a sentinel arbitrarily at some place you're actually wiping out an existing valid data element there. That's not possible. The way to handle this could be one of the ways is this. Observe that I require sentinel merely to signal that I have exhausted a specific array for merging. Here it is not a separate array but a portion of the array. So I could have exhausted either the top portion or the bottom portion while merging. I do the same logic there. I start with P and Q as two pointers which will point to the top half and bottom half. So initially my P points to 0, 0th element and my Q points to n by 2th element. And this is my resultant array. Notice that I have to compare this element with this element to decide which one goes here. If I have to put the burst array into a sorted order. So if this element goes here for example. Then I have to increment the pointer P. Suppose this goes here. I increment the pointer P to next one. And so on. If during this process I have exhausted all elements of either this top half or bottom half. I must not increment P anymore. But comparison should start being done with the smallest possible sentinel value. So notice how that problem is solved here.  Ordinarily for deciding which goes here I would have made a comparison of this type. Whether marks P is less than marks Q. This would have been the statement I would have used in order to decide whether the Pth element goes to the results or Qth element goes to the result. But instead of comparing the two elements of the array. I am extracting them into two temporary variables. Val 1 and Val 2. Val 1 and Val 2 will ordinarily be marks P and marks Q. However if the index P and index Q has already exceeded or already reached the last element. I know that I should not compare that. And therefore I will replace that with a sentinel. And that is the reason why a single sentinel value minus 999 has been imposed. Now this is one way of merging. You could think of different logic as well. This did require some thinking. It is not a trivial problem. And you should get this right. I would expect you to get such problems right. And we will probably have some more sample problems for you to work.  That depends upon Val 1 and Val 2 being compared. Once you do that this output statement is also part. Again this problem I would expect many of you to get it correctly because we actually solved a very similar problem in the class. The last problem did require some thinking. It was a new problem and you are required to look at what you call neighboring elements of a two-dimensional array at some center point. That is something that we are certainly not examined and this was the new. I am very glad to say that as many as 63 students have got the question for B part directly. Which means they could figure out how to calculate the neighbors, how to calculate the median of the neighbors and how to put that in the final value. Okay you have to apply a median filter to a digital image. Now the first part which was I thought was the simplest, even there people have made mistakes. This part required you to declare arrays, variables and read the image array. Declaration should be very simple. An image array of 1200 by 1200. A new image array of 1200 by 1200. There are people who have not declared the new image array. Although I had even specified or suggested a name. I would like you to notice this short end. Please remember that if and when you handle image data of this kind which is monochrome images where the pixel values are between 0 to 255, you would not like to squander away the space and therefore ideally and that is what is done in most professional image processing programs that the arrays are declared as care arrays. So care image 1200 by 1200 because a care can hold an integer value between 0 to 55. However if you declare the arrays as care arrays and read the elements as integers you have a problem because the C in statement will assume for a care array an individual character being given. So if you write 126 it will not read 126 as a pixel value. It will read only one as the character for that particular pixel. So if you declare it as care you have to read individual values on C in and assign those values to individual elements of the array in which case the integer would probably be convert properly be converted to care. However a good compromise is short end which is typically a two byte value. As far as the exam is concerned you could have very well said end and that is perfectly valid there is no problem this is just to explain. Now here's a point you will not think of all possible variables and arrays that you might require to work with when you are writing your program. As you write your program you might require variables. It is perfectly possible and all right for you to declare those variables and arrays as you go by or put them on to write margin something, leave a few lines at the beginning of the program and include all the declarations at the beginning. This is the style which is followed here. So I have hw which is of course stipulated as height and width ijk m etc are variables which will follow indices. I1 and J1 are other index variables I will explain why I have used them. NEB is an array short for neighbors. Why the array is 100 element law? We are stipulated only a 3 by 3 billion filter. In actual practice the filter could be 5 by 5, 7 by 7, 11 by 11, 15 by 15. So therefore this is a generalized version. hw s defines the width it is 3 by 3 so 3 is the width and the total number of pixels within that window is w size which is equal to 9. So if you have used 3 and 9 specifically as constants it is perfectly fine. But remember this whenever you are writing a program try to generalize as much as is possible. So if you believe that filtering could be done with larger arrays which may not occur to you because you are not studying image processing you would automatically try to generalize it and put a larger array here. pmax, ppost, ptem, pmed are all other temporary variables. It is not clear why we need them here but they would become clear as we expand on our idea. Reading the image matrix again very few people have written these comments. These comments were mandatory. You were required to design a file format. You are required to design a format in which data would be given in. The least you should have written is one example is here. That I will prepare a text file in which in the first line I will write two numbers one reprinting the height of the image another reprinting the width and then subsequently I will have many lines they will contain pixel values w pixels for each of h rows. And if I am writing a professional program I will put up this program on the table in which case I will give you an 8 by 8 image data kept in a file image data or text as sample. Whenever you are doing programming projects and you are stipulating some input to be given you are expected not only to define how that input should be given but you are expected to give sample data saying such will look the final data file that you will make. This was mandatory nobody did that. Very few people have written this comment. However most people have read the data but very few people have checked the validity of the data. I can understand if you don't check this I have checked w less than 3 or h less than 3 y. If I am doing median filtering by 3 by 3 window an image of the size 2 by 2 or 2 by 200 that makes sense. But it is okay if you don't check that but you must check whether w specified or h specified is greater than 1200. Sorry this should be h here not w. This is a mistake here. But you must check the bounds. After that you will go ahead and you will read individual elements. I would like you to look at this code carefully. Ordinarily you are expected to validate the data. If you find any invalid data it is perfectly right for you to say sorry data wrong I am fitting. However when you write programs to read large amount of data consider this case you have written somebody has prepared a data file for a thumb print image of 200 by 120 pixels or something. Now somebody has laboriously digitized the data and typed in the value and you find that the fourth row fifth column pixel value is mistakenly written as 1230 instead of 123. Now that is error. Suppose you quit saying sorry you have error here. Now that fellow goes back ok 1230 corrects it. Gives it again.  So every time an error is detected the user will be required to go back check that error correct that error and bring the data back. This is not done in professional programming. In general you will scan through the entire data and validate as much data as you can giving appropriate error messages so that the user can go back and correct all the errors in one shot. So look at how this validation is being done. Again this need not have been done in the exam but I am just for the sake of completeness putting this here I am setting up an input error flag starting with 0. Now I am setting up an iteration i equal to 0 to h minus 1 j equal to 0 to w minus 1 reading individual image elements I am outputting those image elements for the sake of completeness then I am checking whether every pixel value is between 0 to 255 or not if it is not I am printing the coordinates i and j and the value that I have got it but I am not terminating my program. I am continuing with the loop however every time an error is noticed I am incrementing input error flag by value. Now I hope you can guess what we are trying to do. I have printed by 1200 elements even if there are let's say 57 errors I would have printed all those erroneous pixels giving i and j and I would have a count which is 57. So I now know exactly how many errors I have and I am therefore in a position to produce an output of this guy. If input error flag is not equal to 0 then I will say total erroneous pixels found where so much is correct the input file and rerun the program and I don't have to print the erroneous pixels here I don't have to remember them here I have done that job while reading the data itself. So erroneous pixels have been printed, total errors are printed and I am quitting now. On the other hand if everything is okay I proceed to the filter. Now this is where some thinking was required notice first of all what is happening here I have a large image and I have to put up so this is my moving window I am trying to slide this window from left to right starting from the top corner. Consequently this window will be centered on some pixel that pixel is moved by changing i and j. So I am setting up an outer iteration which will move from 0 to h-1 that means it will go from i equal to 0, 1, 2, 3, 4, 5, 6 up to h-1. For each value of i I am changing j from 0 to w-1 so that means I will go through all these pixels. I am essentially covering 1200 by 1200 or w into h pixels in the process each of those pixels will become a center point or a central pixel at which to apply the filter. Dynamically I presume this is my center pixel. What is the coordinates i, j? What are the three neighbors? What are the coordinates of these points? i-1 j-1 i-1 j and i-1 j-1 in exactly the same fashion I can find out the coordinates of these three which are i-1 j-1 and this one will be i-1 j-1 and this one will be i-1 j. Similarly I can find out the coordinates of these what am I required to do? I am required to collect these nine elements 1, 2, 3, 4, 5, 6, 7, 8 and 9 elements and get these 9 elements into separate array, sort them out find out the median and take that median and take the corresponding position to this particular element in the new image array and replace it. I have reproduced these two lines here to explain the logic that I am using. I have to collect 9 elements. So I am varying m from 0 to m less than w size. w size is 9. So m will vary from what values? 0, 1, 2, 3, 4, 5, 6, 7 and 8. Agreed? These are the values in which m will change. What I want to ensure is that the neighbors which I collect have the coordinates i-1 j-1 i-1 j, i-1 j plus 1 etc. It is perfectly alright if you used the actual values here as i-1 j-1 i-1 j etc. and directly assign those values. So you could have said neighbor m or neighbor 0 is equal to this neighbor 1 equal to this, neighbor 2 equal to this, where you stipulate i, j, i-1, j-1 etc. That is perfectly valid. However a better program would be one which will try to generalize this because if instead of 3 by 3 array your filter is 15 by 15 you will choke up writing so many statements. So look at what has been done here I am calculating an artificial variable i-1 which is i plus m by w s minus 1. W s is 3. So observe what happens to i-1 when m is equal to 0 what is i-1? m is 0 divided by w s is 0 minus 1. So basically i minus 1. When m is 1 what is the value of i-1? i. When m is 2 what is the value of i-1? i plus 1. Again look at the next one. When m becomes 3 when m becomes 3 3 divided by 3 is 1. So what is the value of i? What will be j-1 here? j-1 is j plus m modulo w s. Modulo 3 m modulo 3 is 0 1 2 0 1 2 0 1 2 agreed? So I am able to replicate some kind of a sensible movement of i and j i-1 and j-1 around this m. This will take care of my requirements for all the image elements which are within the boundaries. What about edges? The way I have attempted to solve this problem is by saying the following. I have calculated i-1 and j-1 correctly for any given i and j. i-1 and j-1 as m goes from 0 to 8 i-1 and j-1 will span all the pixels which are within that window. That much is correct. The problem is that some of these elements could lie on edges or beyond edges. So before the top edge or after the bottom edge. So here is the possibility. These are four edges. Imagine that my i-j is here. That means my i-1 will actually go below 0. So this is 0. It will go below 0. It will become minus 1. Similarly if I go beyond that this is h minus 1 pixel. This will become h. Obviously when this happens I am supposed to replicate the h pixels. Notice what am I doing here? If i-1 becomes less than 0 I increase that by 1. That means i-1 is brought back to 0. If j-1 becomes less than 0 I increase that by 1. The other edges are similarly taken care of. If j-1 is less than 0 is this but if j-1 is equal to w which is this which means I have gone beyond this edge I will reduce it by 1. By this simple strategy of four statements I am able to replicate the pixels exactly as described in the logic. Including the corner pixels. People have attempted to solve problem c and problem d in the following fashion. They have tried to assign something like nav 0 equal to image i-1 j-1 nav 1 equal to this etc. This they have done for part b and therefore many of them have got the part b corrected. In part c you have four edges 1, 2, 3, 4. So people have mistakenly written these kind of statements for this edge for example. So wherever i-1 is there they will replace it by i. So those nine statements have been written correctly for this edge. Some people got tired at that level. Some people continued and they wrote similar nine statements correctly configured for this edge. So they have written for two edges and they have said similarly for other edges. Unfortunately c++ compiler does not understand the words. Now I have given a solution in one particular fashion. Many of you would think of other alternatives. But I would like all of you to think about implementing a desired logic in multiple different ways and choose the one which is most appropriate. So this particular lecture was devoted to discussing this from Friday onwards we will proceed further. We will now look at the notion of structures arrays of structures do some data processing and other work. But last announcement this was the output. This was the part. You have to sort the array of pixels in the window and after sorting you have to find out the median you have to assign the median to new image that's it. Please note that all of this code is being executed repeatedly for different values of i and j. So at the end you would have the entire matrix covered and then you are supposed to output. Just one second. Even here exactly the same way as you rate the data that was requirement. Many people have goofed up here. So just go through I will be putting up these slides on the web on the model. Please look at them. Thank you so much.


Hello, in this presentation we will define time ticket. According to Fundamental Accounting Principles Wild 22nd edition, the definition of time ticket is source document used to report the time an employee spent working on a job or on overhead activities and then to determine the amount of direct labor to charge to the job or the amount of indirect labor to charge to overhead. When considering a time ticket in this context, we're thinking about the tracking of time for an employee for the reason of applying the cost of that time to a job cost system. We're considering then a manufacturing type company in this scenario, one that produces inventory from raw materials, converting it ultimately to finished goods inventory. Which then is prepared for sale and when sold then is converted from finished good, the asset of inventory to the expense account of cost of goods. Support Accounting Instruction by clicking the link below giving you a free month membership to all of the content on our website broken out by category further broken out by course. Each course then organized in a logical reasonable fashion making it much more easy to find what you need than can be done on a YouTube page. We also include added resources such as Excel practice problems, PDF files and more like QuickBooks backup files when applicable. So once again click the link below for a free month membership to our website and all the content on it sold. The time ticket will be a tool used to track the time and thereby tracking the costs so that we can apply them to a particular job. The job cost system looking something like this. We have the trial balance here. We have multiple inventory accounts, the inventory accounts being broken down into components of inventory, including the raw materials inventory, work and process inventory, finished goods inventory, factory overhead inventory. We can imagine the process here when we're producing inventory of it starting from raw materials, moving then to work and process and or factory overhead, ultimately moving into finished goods inventory, the inventory that then is ready for sale at which time, the time of sale, it will then be moved to the expense account, ultimately the income statement account, the expense account of cost of goods sold. These inventory accounts like all accounts will be backed up and supported by general ledger accounts, including the GL accounts over here of raw materials, finished goods, work and process, factory overhead, those accounts in order by date of transactions within those accounts, the ending balance within the general ledger accounts, equaling what is on the trial balance, for example, raw materials here, adding up to this 170,000 in the general ledger, matching the 170,000 on the trial balance, same idea for the finished goods, work and process, factory overhead accounts. Problem here, however, in terms of a job cost system is that the general ledger doesn't give us enough information to track the inventory costs from say, work and process to finished goods, from finished goods to cost of goods sold. We then need to back that information up in another format, put it in a different order, that order, that format, being job cost sheets. Job cost sheets could look something like this, where we have three jobs, in this example, job 14, job 15, job 16, those jobs, including the costs of materials, labor and overhead per job, and the total of those costs, then being the total costs that we are tracking per job. The time sheets, of course, will help us to apply the correct amounts to each particular job. It's going to be one of the tools that will allow us to apply direct labor to particular jobs and or break out the indirect labor, the amounts that we're not going to be able to apply to a particular job, things like maintenance on the factory or supervisor salaries, those being things that will need to be applied to factory overhead, and then applied to the job in some type of estimating format. Once we have that information, we will then use the job cost sheets to back up the trial balance. For example, job 16 only open job, in our example indicated here, adding up to 260,000, that amount matching what is on the trial balance under the work and process account, and the amount on the general ledger under the work and process account. Other two jobs are closed indicated by this green item here, and therefore these amounts of 186,000 and 314 are going to be included in the finished goods, the goods inventory available for sale, ready for sale, once sold, it then moving from finished goods to the expense account of cost of goods sold.


It's hard to understand what a North Korean regime thinks and what they're actually thinking about this Iran deal, but if I were them, I think the phasing of any deal would now be incredibly important, which is that they're going to want to have any agreement happen where it's going to be the U.S. does something and then North Korea does something. They're not going to sort of want to unilaterally do everything with the hopes that the U.S. will do something because they sort of happen in the Iran deal. We don't know if the administration or another administration might reverse. So I think that's something that will be running through their minds. If I were them, I would demand a treaty. I don't think that's going to happen, but they may demand that and then try to get something in exchange for it or to say, well, how are you going to protect us to make sure that this deal is actually going to be executed if it's over many, many years? But I think the other thing it does is it does sort of, so I voted against Iran deal. I was one of the few Democrats that did that. I thought basically because of their sunsets in it, it was going to allow Iran to have an unlimited ability to enrich nuclear weapons in about 10 or 15 years. I thought that was bad, but it did have pretty intrusive inspections in the deal. It did cause Iran to ship out a bunch of its uranium. It did cause them to pour concrete into one of their reactors. So any deal now with North Korea would seem to have to at least exceed the Iran deal in terms of things that were put in. And I think that's a pretty high standard because you're going to have extremely intrusive inspections of a very close regime. Maybe North Korea will do that. I don't know, but I think the Iran deal does at least sort of up the bar on what's going to be negotiated in terms of what this administration I think would want to accept.


OneWeb isn't just an interesting company. It's an interesting story. And before we get into the recent announcement, I think it's really important that we go over that story. OneWeb was founded in 2012 with the then radical idea of launching 648 microsatellites to low earth orbit. This massive constellation would be 10 times the size of the iridium fleet which in 2012 was the largest ever flown. OneWeb would be used to provide high speed, low latency internet to the entire planet. Sound familiar? Yeah. According to Wikipedia, SpaceX founder Elon Musk and OneWeb founder Greg Weiler were in talks as early as 2014. But it sounds like those talks kind of broke down and then in January of 2015, Starlink was announced to the world. Also in January of 2015, a couple of interesting people were added to OneWeb's board of directors. One was Dr. Paul Jacobs, who was Qualcomm's executive chairman, but the other, the other was Sir Richard Branson, founder of the Virgin Group. With the need to launch the largest satellite constellation the world had ever seen, OneWeb needed a low cost, highly adaptable launch provider. And what you know it, Sir Richard Branson was cooking up just the thing. Virgin Galactic. Now back in 2015 when this announcement was made, Virgin orbit wasn't a thing, but launcher one, the actual rocket that brings payloads to space for Virgin orbit, that had started development way back in 2007. And that rocket is exactly what OneWeb needed. On May 20, 2015, OneWeb entered into a launch services contract with Virgin Galactic. They would pay $6 million per launch for 39 launches for a grand total of $234 million US dollars. But these launches were never to be. The first OneWeb satellites would not launch in 2015 and in fact they would not launch until February 27, 2019. They wouldn't fly board Virgin Galactic nor Virgin orbit. No, these first six satellites flew on a Soyuz rocket via Ariane space out in French Guiana. Then on February 6, 2020, OneWeb launched 34 more satellites aboard yet another Soyuz, this time out of Kazakhstan. A month later on March 21, Soyuz delivered 34 more satellites, bringing the OneWeb constellation from nothing at the start of 2019 to deploying 68 new satellites in just two months. The path to success was imminent. It looked like nothing could stop OneWeb except maybe global pandemic. Six days after that March 2020 launch, OneWeb officially declared bankruptcy, citing COVID-19 as their primary reason. Thing is, OneWeb still had that launch contract with Virgin and Virgin orbit wanted their money. When OneWeb went into bankruptcy, apparently it triggered a cancellation penalty worth $70 million. Part of that was paid, but $46.3 million was outstanding and Virgin orbit wanted that cash cash money. In July of 2020, OneWeb began exiting bankruptcy protection with the aid of the government of the United Kingdom in Softbank. In November of that year, Neil Masterson was named the company's new CEO. Then in December of 2020, OneWeb would resume launches out of Kazakhstan, still via Soyuz. Okay, a few bridges may have been burned, like not probably flying on a Falcon 9 or Launcher 1 anytime soon, but that's okay. They still have Soyuz. Launches continued through 2021, bringing their constellation to 428 strong, making it one of the largest in orbit, second only to Starlink. So at this point, OneWeb has basically successfully navigated the pandemic. Maybe a little bit bumpy, right? They entered into bankruptcy, but they got out of bankruptcy. Their satellite constellation is being built. Rockets are launching. It's hard to imagine that the universe would throw anything else at them, right? This is an ABC News special report. Now reporting David Muir. Good evening, and we're coming on the air at this hour with breaking news after the U.S. warned all day of a full-scale Russian invasion of Ukraine that it was imminent. Vladimir Putin has just addressed the Russian people a moment ago, announcing what Putin called the start of a military special operation, in his words, to demilitarize Ukraine. On February 24, 2022, Russia invaded Ukraine, and the world was thrown into even more chaos. Thing is, the Soyuz rocket is a Russian-made vehicle. And with the worldwide sanctions on Russia, it wasn't looking likely that OneWeb would be able to keep launching. And even if they could, Russia came back with some pretty intense demands, including proving that OneWeb guaranteed their constellation wouldn't be used for military purposes, but more importantly, that the British government, a huge financial supporter of OneWeb post bankruptcy, withdraws their support. Russia knew this wasn't possible, so no more Soyuz launches for OneWeb. Okay, so Falcon 9's out. Launcher 1's out. Soyuz is out. Who do they have left? Rocket Lab? Electron? Like, there's no one else, right? Well, that's what I thought. But I was wrong. In March of 2022, OneWeb announced an agreement with SpaceX to launch a board Falcon 9. Then, in April, OneWeb announced that they would also be launching a board, the ISRO, or Indian Space Research Organization's GSLV Mark III rocket. Neither of these has happened yet, but according to the Wiki, the first Falcon 9 launch is set to happen quarter four, with GSLV happening in October, both of this year. And actually, fun fact, Toid, this will be the first commercial customer ever for the GSLV Mark III. I did not know that until researching this news story. And that brings us to today and their announcement. With their Generation 1 satellites now back on a path to being deployed into orbit, they're looking forward to their future and to Gen 2. This last week, Relativity Space announced that they have signed a launch services agreement with OneWeb to loft their Gen 2 satellites aboard their upcoming Terran R reusable launch vehicle. Now, we really don't know much about the OneWeb Gen 2 other than it's called OneWeb Gen 2, but we do know that the Terran R launch vehicle will have about the same up mass as the Falcon 9. Relativity Space's Terran R rocket is all sorts of epic. It's the first fully 3D printed rocket on the planet. Reusability? Absolutely. All stages and fairings are fully reusable. The Terran R has a mass to Leo of 20,000 kilograms when in fully reusable mode. Since the Soyuz has less than half of that capacity, one could assume that this will enable OneWeb to launch double the number of satellites. That of course assumes that the new Gen 2 units are not much heavier and will all fit in that fairing. But all in all, this announcement is really, really exciting. The announcement itself is really just that they've announced they're going to launch on a future upcoming rocket that frankly doesn't quite exist just yet and won't launch until 2024. But it shows that OneWeb is once again looking to the future. And that's a good place to be. So at this point, OneWeb appears to be firing on all cylinders again. 66% of its Gen 1 constellation is currently flying with the last 34% slated to resume their rides uphill later this year. OneWeb has launcher redundancy between SpaceX and ISRO. And they have a next generation platform in the works with yet a third launch provider that's all sorts of epic. I think it shows OneWeb leaving crisis mode and moving into future business mode, a great place to be. Say what you will about OneWeb, but they have held on this entire time and fought bitterly to survive. It will be extremely interesting to see where they go from here. And speaking of fighting for survival, I'd like to thank everyone who helped make this episode happen. These are people who contribute to the shows that tomorrow each month. Without you, we couldn't afford to make all of this go as tomorrow, continually week after week, month after month, also fights bitterly for survival. And fret not, Ryan isn't gone. He's just busy this week, so I'm stepping in and trying a new format where we cover one story per day. No idea if it'll work, but you know, trying something new, that's kind of my M.O. Hopefully I'll be able to do something Monday through Thursday with some sort of a live show on Friday. We'll see how it works. Love your comments down below. Not sure if I'll be able to pull it off, but you know, working on it. And if you want to help the shows of tomorrow but can't afford to financially contribute, we'd love to have you help us research, produce and edit these shows too. All of this takes a long, long time and we all have day jobs or school and your help would go a long way to ensuring that we continue to crank these things out and give you space geeky content day after day, week after week. And on that note, my name is Jamie Higginbotham and I hope you have enjoyed today's episode of Space News. I hope to see you soon. And for my fellow Americans, happy 4th of July. Okay, I don't want to do this again.


And you are welcome back and we are going to hit the ground running like we always do on this next segment. We'll talk about the health sector and the National Association of Resident Doctors, the strike that was just called off and all of that. So resident doctors who work at the Abia State University of Teaching Hospital are owed 20 months salary. You heard that right. It's true. They say 11 of those 20 months are under the government of Governor Ocasio-Piazzo, while nine months are under the previous government. The doctors are now demanding to be paid. They've already met with the state government and got a commitment that 11 months salary, salaries will be offset soon, which is why the president of the National Association of Resident Doctors in Abia State, Dr. Kingsley Nguyen-Muay-Muay is joining us this morning. Doctor, thank you for joining us. Thank you. So it's mind-blowing 20 months. Let's start from the beginning. Right. How have your members been surviving without salaries? Okay. On a very good day, it has been a very hard time for the resident doctors in Abia State Teaching Hospital because of the 20 months salary being owed to them by the Abia State government. It has not been easy because most of them find it difficult to feed, find it difficult to transport, they seem to work because they are willing to work. That's why they be working to this period, you know, the accumulation of that salary. There are most of the resident doctors, also finding it difficult to register for exam to go for West African College or National Postgraduate College exams. So it has not been easy for us to survive, but we thank God at least we are alive today and managing while waiting for the governor to do his own facts. Okay.  The previous administration in Abia State owed you guys nine-month salaries. When did this start and why exactly did your salaries stop coming in? Before, of course, Tokizek Pazou came in and continued with the same non-payment of salaries. When did it start? Okay. Actually, the former governor, Senator Teoji, was owing the institution some months of salary before he left. Then on the assumption of office by the current governor, Tokizek Pazou, he paid some money, almost, I think, 11 months or so when the Paris fund was given to them by the present government, by the federal government. So he paid some money to assist the institution to place some of the salary areas. But unfortunately, as time went on, he started owing us, then saying that he was going to pay, that he has other things while waiting for money to come, that the money he used to get is not what he gets almost at the end of the month from the federal government. So I think that was where he started owing us. Let me understand. You said he made some payments when he came in. Does that mean he offset the debts that Teoji left or was there more? Because you just mentioned 11 months. Yes, he paid, he paid, he was owing some months too when he came in. But he paid up to, I think, 11 months, you know. So from the meeting we had with him last Thursday, he made us to understand that all the money he paid was during his own administration and not during, not for Teoji, the night most inherited. So that was the clarification he gave us. All right. Well, it's not a very, very good story. And I feel really bad for, you know, doctors in Nabiya state. But let's also talk about the NERD strike that has just been suspended. How do you feel about that being national body of the NERD doctor? Of course, the president, we spoke with him, Dr. Uilawa, who said that they have agreed and they have gotten promises from the federal government and they will be suspended in the strike.  Okay. We thank our national presidents because he sends delegates to absolute, you know, to other states to interact with the, with the, with the governor of other states. Okay. Including the former NERD president because that day he was having a meeting, you know, with the representative of the House of Assembly. So when we had the, the call off, he told us that we should still continue on the strike, you know, based on the negotiation on the agreement the governor made with them that day, that he's going to want, you know, within 10 days he's going to grant some money for re-acquired session of residency training in that new station. Then within 20 days he's going to study the medical residency training act of 2017 and see possible implementation of that act in other states. So he also told them that day that he's going to start paying monthly starting from April 2021. So that was, then when he gets money he will start paying the, the, the areas, you know, so that the money he's getting is not enough for him to carry all the things out. So when we had the, it was suspended, well, we felt, we felt there is a reason, because the reason they gave us was that they want to give further government time and the state government time within one month so that we enable them to pay all the money they are owing to their members and also to solve the problems of the, of the association. So the government requested one month which they granted, you know, so that's the situation sir. No, there's something you said that caught my attention that the governor said if he gets monies, that's when he's going to start paying the backlog. Right. If you look at the front page of the punch today, we saw this headline states face cash crunch salaries, swallow revenues that's coming from the state governor. So if he doesn't get money, what happens? Franklin speaking, it will be, it will be a very hard situation for us. The governor is a, is a loving governor and we feel that he should, he should know the flights we are in because we have cried unto him. We have met the, the, the, before this time, we have written several letters to him, you know, saying our plight and also the, with the intervention of the national body, which will be agreed, you made some promises. I think you will, you will keep to his promises. All right. Well, there's expectations from the federal government to keep to similar promises. And you've also mentioned that the state government, you know, you expect that they will keep to their promises. You know, so we hope that, you know, these things actually happen, like you said, but it, it might be a little stretch, you know, if he's saying that he's going to pay salaries from April, is there any money that you feel that the state government is expecting that would change the finances of, of the state from April? Okay, sir. You know, he is the governor of the states. So he knows how he gets money to run the states. I may not be in the, in the, in the best situation to say how he gets money, but for him to make a promise to the non-leadership, the delegates is, you know, that means he's expecting some money somewhere that will enable him, you know, start solving our problem. So I can't say exactly that this is the source where he's getting the money from. Yeah. And how does this also affect other medical workers in Abia state? Is it just resident doctors now that, you know, old salaries? No, the whole, the whole health workers, the old workers, too, in other states are being owed the same salary because once the money comes, everybody receives his own salary. We just, um, um, yesterday, uh, yes, what did yesterday, uh, today? So on Tuesday, we just got one salary on Tuesday. For which month? We got one more salary. So that money was everybody, all the health workers got, uh, their own salary. So it's not only the resident doctors that are being owed, every health worker, they are passing through the same, um, problems we are facing. Okay. So the picture you're painting here is it doesn't look good at all. So I would like to ask, apart from salaries, do you train your members to try to survive on, you know, um, some others, I don't know, apart from the work they do on the salaries they expect, is there any other way they can try to survive without, uh, waiting for salaries? Um, on a, on a very good note, there is no other work I know of their being because they are resident doctors. So they keep managing the, the, the patients that come into the hospital, the consultants will see the, the, the patients along with them. Then after that, the resident doctors will continue to follow up the patients or the patient gets where, or the patient is being discharged. So I think they are committed to their work.  So how they survive, I think is, is the grace of God. What would you say happens if these promises are not fulfilled, uh, uh, promises made by the Abia state governor, um, to, of course, pay from the month of April. What, what happens next? I think the, the institution will still be on strike because they don't have any money to transport themselves. I'll speak to you now. Many of them have been complaining that they don't have money to transports to come to school there to, to come to work. And also most of them have to complain in that, um, their house friends has inspired and you know, they don't have money to do other to send their children to school. So I think it's going to be a hard problem. It's going to be hardship on our own parts. You know, but we don't pray that the governor will allow this to happen again, because, um, from the assurance this is gay, he gave the non-leadership. He said it in front of the horrible commissioner for health, then the, uh, assistant, um, uh, uh, the special advisor on health of other states and other people there. So we are just believing his ways being our father that is going to look into our problem because if he, if he, if he allows it to, to escalate, it's going to be a big problem for us. We won't even have money to eat, talk later, coming to work. And our patients will, will suffer it most. All right. Dr. Kingsley, we will thank you very much for speaking with us this morning. Thank you sir. All right.   If you were all resident doctors for 20 months, how exactly do your health, you know, is the health system in Abia state functioning? And what, what does the, the governor really mean? And I hope that we can bring in a representative from the government, um, the Abia state government to speak on this. What does the government really mean by there's no money currently to pay, you know, salaries and from April, they, you know, might have some money. So if there wasn't the Paris club refund, uh, back then, like he stated, it means that they wouldn't be paid salaries. Yeah. Oh, if there's no, uh, help from the federal government, how do they call it, uh, bill out, bill out funds and all of that. It's absolutely no sense. Yeah.  Father, mother, auntie, uncle, whoever he is. Oh, you have an issue with that? Yes. I don't, I personally don't like when, you know, you, you reach out and say, well, the father of the state and some of all of that, you know, what is, what is wrong is wrong and what is right is right. What, you know, the responsibilities of a governor are, you know, they, all these things, you know, are part of the responsibilities to ensure that the state generates enough IGR and if you can't be a governor and ensure that your state can fund itself and function at, you know, as a, as a state, then what are you doing there? It makes absolutely no sense. In what ways has the internal generator revenue of Abia state increased in the last couple of years for you to be able to pay your workers? You know, and if you can't say that in the last two, three, four years, this is how we've increased IGR. This is, these are the new things that we're investing in. This is how we have paid our teachers and our health workers and our security agents and whatever. Then what are you doing there? Oh, this is the way we are trying to cutting, we are trying to cut cost. It is, why are they not looking at that angle to cut cost of governance and all of that? Reduce their aides and all. All right, we'll take a short break when we come back. More of these conversations here on the breakfast. Good morning.