Write and Execute four programs based on the content of previous lectures. You n

Write and Execute four programs based on the content of previous lectures. You need to write and execute programs using visual c#. 1.Write C# code to declare two integer variables, one float variable, one Boolean variable, one char variable and one string variable and assign values, then find the addition of one integer and float variable. Then display their values on the screen. 2. Write a program named Check Credit that prompts users to enter a purchase price for an item. If the value entered is greater than a credit limit of $5,000, display an error message; otherwise, display Approved. 3. Write a program named Admission for a college’s admissions office. The user enters a numeric high school grade point average [GPA] (for example, 3.2) and an admission test score. Display the message Accept if the student meets either of the following requirements: • A grade point average of 3.0 or higher, and an admission test score of at least 60 • A grade point average of less than 3.0, and an admission test score of at least 80 • If the student does not meet either of the qualification criteria, display Reject. 4. Write a program named CheckMonth that prompts a user to enter a birth month. If the value entered is greater than 12 or less than 1, display an error message; otherwise, display the valid month with a message such as 3 is a valid month.

A microprocessor has an increment memory direct instruction, which adds 1 to the

A microprocessor has an increment memory direct instruction, which adds 1 to the value in a memory location. The instruction has five stages: fetch opcode (four bus clock cycles), fetch operand address (three cycles), fetch operand (three cycles), add 1 to operand (three cycles), and store operand (three cycles). By what amount (in percent) will the duration of the instruction increase if we have to insert two bus wait states in each memory read and memory write operation?

Suppose a LAN is to carry voice and packet data traffic. Compare and discuss the

Suppose a LAN is to carry voice and packet data traffic. Compare and discuss the provision if any are required to handle the voice traffic in the reservation, polling, token ring, ALOHA and CSMA-CD environments. Explain the changes that required for the packet data traffic. You may support your answer with diagram, table

Scenario:The scenario for this assessment is a hypothetical future system that h

Scenario:The scenario for this assessment is a hypothetical future system that helps governments to manage traffic flow in municipal localities. You should imagine that the local Road Traffic Authority has put out a Request for Proposals (RFP) for appropriately qualified consultants to undertake a body of work that would help to scope the data requirements for such a system. With your success in your Torrens University Australia degree so far, and other similar projects that have garnered you some sustained success in the eyes of the profession and community, you have been shortlisted among no less than 10 other consultancies. There are expectations from them, then, as to the standard of report you will produce.While there has been a tremendous amount of attention given in the media and in scientific circles to the progression and uptake of autonomous vehicles, their widespread adoption has not yet proliferated: there are reasons for this that you will need to take into account in your deliverable. The local Road Traffic Authority is, with several other bodies, lobbying the government on what it can manage in the emergent world of technological change and the capability of artificial intelligence. An alternative model has been proposed that the Road Traffic Authority believes to bepreferable to autonomous vehicles and it involves a system that would control all non-autonomous, driverless vehicles through a traffic management and routing system.For such a system to work, it is necessary that there be no autonomous vehicles on the road, and AI- enabled as well as human drivers would be included in such a ban. With the remaining non- autonomous, driverless vehicles the only ones left on the road, the system would then be allowed to control the flow and routing of each and every vehicle by manipulating its speed, direction and ultimate route to the passengers’ intended destination. The system would control all traffic lights, lane changing, slowing and acceleration of the vehicles.The benefits of such a traffic management system are thought to be enormous as the hope is that the most effective routes can be calculated and that the most efficient traffic flow between those destinations is streamlined, congestion minimised and safety on the roads improved. But the system is ambitious and requires a lot of forethought and design elements fed into it before it could be seriously considered by the government of the day. The Road Traffic Authority seeks consultation on what the data requirements of such a hypothetical system might be.

Assignment You will be writing a program designed to read in a text-based pictur

Assignment You will be writing a program designed to read in a text-based picture file, manipulating it, and then writing the manipulated picture file into an output file. PPM File Format A PPM file is called a “Portable Pixel Map”, which is essentially a plain-text file of numbers from 0-255 which describe the color channels of a picture. The very first line is always “P3”, which identifies this as a PPM file. If this file does not contain P3, do not read it, and let the user know that there was an error. The second line contains two values in order: width and height. These describe the width and height in pixels. The third line contains one value: max intensity. This describes the maximum intensity of a color value starting at 0. This value is typically 255, but you cannot assume it is. The rest of the lines contain three values: red, green, and blue. These are integers that describe the amount of color each pixel gets. These values must be in the range of [0..max intensity]. If you find a value that is > max intensity, WARN the user, and set the pixel’s value to max intensity. ANY line beginning with a # is a comment, and it must be ignored by your program. You do not need to check if # is anywhere else in the file, such as after a value on the same line. The red, green, and blue values may be on a line by themselves, or they may be on a single line, or may be split between a line, whitespace, comment, and another line. Your program must be able to handle all situations. PPM file example P3 #width height 5 4 #maximum intensity 255 #row 0 2 9 4 100 200 100 7 9 1 91 99 94 18 44 19 #row 1 72 91 44 88 44 12 91 99 94 14 55 22 19 88 77 #row 2 44 12 22 91 99 94 78 44 19 191 215 222 177 199 121 #row 3 41 98 111 91 99 94 22 11 22 177 144 121 91 99 94 The PPM file example above contains the ‘P3’ identifying this as a PPM file. It then has a width of 5 pixels and a height of 4 pixels. This means that there should be exactly 20 pixels (5 x 4) laid out after the maximum intensity, which for this file, is 255. The pixels are both in a row and on lines by themselves. You cannot assume how the PPM file will store the pixels. So, your program must handle multiple pixels per line as well as multiple pixels on their own lines. Notice that there are three values per pixel. In order, these are the values for the red, green, and blue color channels. Structures Pixel Create a Pixel structure that contains three members which will contain values between [0..max intensity]. Only positive numbers will be stored. One member will store the value of the red channel, one for the green, and lastly, one for the blue channel. Picture Create a Picture class that contains: Private Members a vector of vectors of Pixel structures. This will be a two-dimensional vector representing rows and columns (row-major). an integer representing the number of rows in the picture (height). an integer representing the number of columns in the picture (width). an integer representing the maximum intensity of each pixel color. Public Members a constructor that takes no parameters and initializes the Picture to a height of 0, width of 0, and an intensity of 0. 2 .a function called copy, which takes a vector of vectors of Pixel structures by-reference. a function called readFile, which will take a string by-reference and return a bool. a function called writeFile, which will take a string by-reference and return an integer. a function called xflip, which takes no parameters and returns nothing. a function called yflip, which takes no parameters and returns nothing. a function called neg, which takes an integer and returns nothing. a function called greys, which takes no parameters and returns nothing. read This member function will read the PPM file, whose filename is passed via a const-referenced string. If for any reason the file could not be read, return false. Otherwise, read the file, populate the vector of vectors of Pixel structures with the value of each group of three values (red, green, and blue), the maximum intensity, and the width and height of the picture. You must error check the given file after you read it. Make sure that the P3 is the first line. Also, make sure that the number of pixels retrieved is exactly the amount given by the picture’s dimensions. writeFile This member function will write a PPM file, whose filename is passed via a const-referenced string. The return value is an integer and is an error code. Use the table below to determine what needs to be returned. Error Return Value No error 0 The picture is empty -1 The output file cannot be opened -2 No other errors need to be handled. xflip This function will take the current picture and flip it around the the X axis. The picture should look upside-down when this function is complete. This function must be done in place. Do not create any additional vectors. If the picture is empty, this function does nothing. yflip This function will take the current picture and flip it around the Y axis. The picture should look mirrored when this function is complete. This function must be done in place. Do not create any additional vectors. If the picture is empty, this function does nothing. neg This function will take an integer, which is the color channel, or combination of color channels that need to be negated. This function will do all operations in place. The integer parameter controls which color channel to negate as given below: Parameter Color channel(s) 1 Red 2 Green 3 Blue 4 Red and Green 5 Red and Blue 6 Green and Blue Any parameter outside of 1-6 will cause this function to do nothing. greys This function will take the average of all color channels for a single pixel and set each pixel’s color to that single value. This will cause the picture to be different shades of grey. copy This function will copy the private vector into the by-reference parameter. This function is required to clear out any old data in the parameter first! Testing Your Picture The testing of this lab does not use any int main(). However, you should build your own testing structure to ensure your lab is correct.

Write a class named TicTacToe that has two private data members: the board, whic

Write a class named TicTacToe that has two private data members: the board, which will be a list of lists that represent a 3×3 board, and the current state. It should have a get method named get_current_state. The class should have an init method that initializes the board to a list of three lists that each contain three empty strings (where each represents an empty square), and initializes the current_state to “UNFINISHED”. It should have a method named make_move that takes three parameters, a row and a column (in that order) where each is an integer in the range 0-2, and either ‘x’ or ‘o’ to indicate the player who is making the move. If the row or column are out of bounds, or if that square is already occupied, or if the game has already been won or drawn, make_move should return False. Otherwise, it should record the move, update current_state to the appropriate value, and return True. The possible values of current_state are: “X_WON”, “O_WON”, “DRAW”, or “UNFINISHED”. It’s possible for multiple moves to be made in a row for the same player. A game is drawn when all of the squares are filled, but neither player has won. It’s not required, but you’ll probably find it useful for testing and debugging to have a method that prints out the board. Whether you think of the array indices as being [row][column] or [column][row] doesn’t matter as long as you’re consistent. Code must be in python, not C++ or Java.

Write a class named TicTacToe that has two private data members: the board, whic

Write a class named TicTacToe that has two private data members: the board, which will be a list of lists that represent a 3×3 board, and the current state. It should have a get method named get_current_state.The class should have an init method that initializes the board to a list of three lists that each contain three empty strings (where each represents an empty square), and initializes the current_state to “UNFINISHED”.It should have a method named make_move that takes three parameters, a row and a column (in that order) where each is an integer in the range 0-2, and either ‘x’ or ‘o’ to indicate the player who is making the move. If the row or column are out of bounds, or if that square is already occupied, or if the game has already been won or drawn, make_move should return False. Otherwise, it should record the move, update current_state to the appropriate value, and return True. The possible values of current_state are: “X_WON”, “O_WON”, “DRAW”, or “UNFINISHED”. It’s possible for multiple moves to be made in a row for the same player. A game is drawn when all of the squares are filled, but neither player has won.It’s not required, but you’ll probably find it useful for testing and debugging to have a method that prints out the board.Whether you think of the array indices as being [row][column] or [column][row] doesn’t matter as long as you’re consistent.

In this assignment, you are expected to design and implement a simple file syste

In this assignment, you are expected to design and implement a simple file system (SFS) that can bemounted by the user under a directory in the user’s machine. You need to demonstrate a file systemworking in Linux. It may work with some modifications in other Unix-like operating systems (e.g., OSX). To simplify the assignment, SFS introduces many limitations such as restricted filename lengths, nouser concept, no protection among files, no support for concurrent access, etc. This is a design assignment.Therefore, several aspects of the SFS are left undefined. It is your responsibility to make valid assumptionsand document them. No matter what assumptions you make, your implementation should work with thetesters and also it should be mountable through FUSE to get full marks.Here is a list of restrictions we propose for SFS. You could add more provided you keep the SFSfunctionally compatible with the testers and FUSE. You need to document all the simplifying assumptionsyou make.• Limited length filenames (select an upper limit such as 16)• Limited length file extensions (could be set to 3 – following the common extension length)• No subdirectories (only a single root directory – this is a severe restriction – relaxing this wouldenable your file system to run many applications)• Your file system is implemented over an emulated disk system, which is provided to you.Here is a schematic that illustrates the overall concept of SFS in direct mode. You need to implement theyellow (orange) component. The other two components (tester and disk) are given to you.

In this assignment, you are expected to design and implement a simple file syste

In this assignment, you are expected to design and implement a simple file system (SFS) that can bemounted by the user under a directory in the user’s machine. You need to demonstrate a file systemworking in Linux. It may work with some modifications in other Unix-like operating systems (e.g., OSX). To simplify the assignment, SFS introduces many limitations such as restricted filename lengths, nouser concept, no protection among files, no support for concurrent access, etc. This is a design assignment.Therefore, several aspects of the SFS are left undefined. It is your responsibility to make valid assumptionsand document them. No matter what assumptions you make, your implementation should work with thetesters and also it should be mountable through FUSE to get full marks.Here is a list of restrictions we propose for SFS. You could add more provided you keep the SFSfunctionally compatible with the testers and FUSE. You need to document all the simplifying assumptionsyou make.• Limited length filenames (select an upper limit such as 16)• Limited length file extensions (could be set to 3 – following the common extension length)• No subdirectories (only a single root directory – this is a severe restriction – relaxing this wouldenable your file system to run many applications)• Your file system is implemented over an emulated disk system, which is provided to you.Here is a schematic that illustrates the overall concept of SFS in direct mode. You need to implement theyellow (orange) component. The other two components (tester and disk) are given to you.Figure 1: SFS in direct mode.The problem with the direct mode is that SFS is only usable by your program. You may not be happy aboutit! Why not use SFS to store data created by an editor like vi? The mountable version of SFS addressesthis problem. It allows you to store anything and treat SFS like an extension of the OS. The magic isperformed by FUSE – file systems in user space. The concept of FUSE is similar to the concept we saw inmicro kernel OSes. I said it is similar to micro-kernel OS (it is actually not).

1 2 3 5