Lab 2 Fun With A Maze Csc 254 Please Complete And Get Part I Signed Off Before D

Okay so, I have uploaded my entire lab assignment ( just for clarity sake ). I have completed Part I and I would say half of Part II, but I am having trouble communicating two files to each other. I am already doing it once, but I don’t fully understand how I even did it so I don’t know how to apply it to another file. A quick summary of what the lab is, is a 3×3 maze (I will input what it looks like at the end but it may look weird with formatting) but I am to have a 3×3 maze with a 1 representing a wall, 2 represents the initial location, and 3 represents the end location. 002 010 030 This would be the Part 1 on the lab, but we are to replace wherever the player is (Number 2) with X, so it would be: 00X 010 030 And now I need to code instructions that I am able to move the X to the 3 and notify the user when you are unable to go a certain way due to a wall or out of bounds. Hopefully someone can help because the teacher was even willing to extend the deadline for me, but the book isn’t really helping with this.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Lab 2 Pre Lab Questions 1 Of The Four Major Types Of Microscopes Give An Example

Lab 2Pre-Lab Questions

1.   Of the four major types of microscopes, give an example of a scenario in which each would be the ideal choice for visualizing a sample.

2.   What is the difference between the coarse adjustment knob and the fine adjustment knob? When is it appropriate to use each of them?

3.   If you are using a compound microscope with an ocular lens with a magnification of 10x and an objective lens with a magnification of 40x, what is the total magnification?

4.   In this lab, we discussed preparation of a wet mount slide. Research and describe another slide preparation and an example of when it would be used.

Lab 2Experiment 1: Virtual MicroscopePost-Lab Questions

1.   What is the first step normally taken when you look through the ocular lenses?

2.   What does it mean that the image is inverted when you look through the ocular lenses?

3.   What new details are you able to see on the slide when the magnification is increased to 10x that you could not see at 4x? What about at 40x?

4.   Why is it important to be able to properly calibrate and measure objects viewed through a microscope?

5.   Describe the qualitative difference you notice with the different types of microscope views in the “Microscope Compare” and “Specimen Compare” exercises.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Lab 4c Loops Complete A Program To Draw Circles Arranged In A Grid For Example

Hi this is the second time i am posting this and I am hoping that someone can actually help me! This is actually really simple for someone who knows how to code in Java!!! The code that is already given, CAN NOT BE ALTERED!!!!!! It is simply filling in the two spots where it says “enter code here”. I know the second part has a loop within a loop. If someone can please hep. Thanks! Remember, you CAN NOT ALTER the given code!

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Lab 5 Traveling Salesperson Problem With Depth First Search We Will Explore Two

Lab 5- Traveling Salesperson Problem with Depth First Search

We will explore two algorithms for solving the very famous traveling salesperson problem. 

Consider a graph of cities. The cost on an edge represents the cost to travel between two cities. The goal of the salesperson is to visit each city once and only once, and returning to the city he/she originally started at. Such a path is called a “tour” of the cities. 

How many tours are there? If there are N cities, then there can be N! possible tours. If we tell you which city to start at, there are (N-1)! Possible tours. For example, if there are 4 cities (A, B, C, D), and we always start at city A, then there are 3! possible tours: 

(A, B, C, D) (A, B, D, C) (A, C, B, D) (A, C, D, B) (A, D, B, C) (A, D, C, B) 

It is understood that one travels back to A at the end of the tour. 

The traveling salesperson problem consists of finding the tour with the lowest cost. The cost includes the trip back to the starting city. Clearly this is a horrendously difficult problem, since there are potentially (N-1)! possible solutions that need to be examined. We will consider DFS algorithms for finding the solution. 

The DFS algorithm is exhaustive – it will attempt to examine all (N-1)! possible solutions. This can be accomplished via a recursive algorithm (call it recTSP). This function is passed a “partial tour” (a sequence of M cities (M <= N) which is initially empty) and a “remaining cities” (sequence of N cities). There are clearly M-N cities not in this partial tour. Thus the function recTSP will have to call itself recursively M-N times, adding each of the M-N cities to the current partial tour out of the remaining cities. If M=N we have a complete tour. 

For example, we start with recTSP ({A}). This will have to call recTSP ({A, B}), recTSP ({A, C}, and recTSP ({A, D}). Here is a partial picture of how the sequence of function calls is done. This tree is not something you build explicitly – it arises from your function calls. You traverse this tree in a “depth-first” manner, The numbers tell you the order in which the nodes are processed. 

Each leaf node is a complete tour, which you will compute the cost of. Note that each non-leaf node is an incomplete tour, which you can also compute the cost of. If the cost of an incomplete tour is greater than the best complete tour that you have found thus far, you clearly do not have to continue working on that incomplete tour. Thus you can “prune” your search. 

Just how hard are these problems? For example, if there are 29 cities, how many possible tours are there? If you can check 1,000,000 tours per second, how many years would it take to check all possible tours? Has the universe been around that long? 

Since this program may take too long to complete, be sure to output the tour and its cost when it finds a new best tour.  

We have to first develop the distance matrix, also called adjacency matrix. This adjacency matrix is populated using a given data file. You will run your program to find the best tours for 12, 14, 16, 19, and 29 cities.

Here is a sample code to populate the distance matrix

 public void populateMatrix(int[][] adjacency){

int value, i, j; 

for (i = 0; i < CITI && input.hasNext(); i++) { //CITI is a constant  

  for (j = i; j < CITI && input.hasNext(); j++){ 

    if (i == j) { 

          adjacency[i][j] = 0;

    }

    else {

          value = input.nextInt();

           adjacency[i][j] = value;

           adjacency[j][i] = value;

    }

  }

}

}

Here is an algorithm to compute tour cost

Algorithm computeCost (ArrayList<Integer> tour)

           Set totalcost = 0

      For (all cities in this tour)

          totalcost += adjacency [tour.get(i)][ tour.get(i+1)]

           EndFor

           If (tour is a complete tour)

                       totalcost += adjacency [tour.get(tour.size()-1)][0]

           EndIf

           return totalcost

 End computeCost

Here is the DFS algorithm

Use ArrayList for “partialTour” and “remainingCities” – This implementation is inefficient due to higher space complexity. 

/* requies : partialTour = <0>, remainingCities = <1,2, 3, ….N-2, N-1>

  ensures: partialTour = <0,…..n> where n E <1,2,3, …, N-1> &&

                Cost(partialTour) is the absolute minimum cost possible.

*/

Algorithm recDFS (ArrayList<Integer> partialTour, ArrayList<Integer> remainingCities )

           If (remainingCities is empty)

                       Compute tour cost for partialTour

                      If (tour cost is less than best known cost)

                                  Set best known cost with tour cost

                                   Output this tour and its cost

                       EndIf

           Else

                       For (all cities in remainingCities)

                                   Create a newpartialTour with partialTour

                                   Add the i_th city of remainingCities to newpartialTour

                                   Compute the cost of newpartialTour

                                   If (newpartialTour cost is less than the best known cost) // pruning

                                               Create newRemainingCities with remainingCities

                                               Remove the i_th city from newRemainingCities

                                               Call recDFS with newpartialTour and newRemainingCities

                                  EndIf

                       EndFor

           EndIf              

 End recDFS

The minimal cost path for 12 cities is 821, and the minimal cost path for 29 cities is 1610, but 29! = 8841761993739700772720181510144 (!!!!!)

Well, Sorry to disappoint you. We will have to wait until the midterm to implement the second algorithm!!! 

Turn in your source program and outputs as an attachment of this assignment. You should turn in your outputs in a PDF. Do not turn in PDF with source code!!! 

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Lab 5 555 Clock Timer And Dc Motor Speed Control Objectives 1 To Simulate And Op

Hi, I have been problems with this lab, please see attachment!

Note: You will use MultiSIM in XenDesktop to complete this assignment.

  • Lab 5:555 Clock Timer and DC Motor Speed Control

Instructions for completing the Lab report

  • The report is to be typed and prepared following the guidelines listed below.
  • Send MultiSim Circuit Files or other software specific files used in the course (if applicable) separately from the lab report.
 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Lab 6 Void Functions Enter The Example Program And Make It Work Modify The Pro

Lab 6 – Void Functions

Enter the example program and make it work. Modify the program as follows:

·        Add input prompts to the program

·        Make a version of it to print a second record to the output file making an additional call to the proper function

·        Revise the program to ask for the number of records to enter. Then have it process that number of records and place them in the file.

·        Finally, similar program to input Employee name, hours worked and pay rate and calculate gross pay, with the data being placed on the screen and in a data file as it is here.

·        Upload the files to the BlackBoard site (or send them as attachment to email).

·        Save the programs. We will have revisions to them later.

  • Attachment 1
  • Attachment 2
 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Lab 6 File I O External Data Representation Fopen Fclose Fread And Fwrite Struct

A less-used fifth operation, SEEK(), allows you to set the read/write position directly without reading or writing.

Almost every programming language supports a version of this interface. You may recognize it from Python. For the C programmer, this interface is provided by these four system calls defined in stdio.h:

FILE * fopen( const char * filename, const char * mode);size_t fwrite( const void * ptr, size_t size, size_t nitems, FILE * stream);size_t fread( void * ptr,size_t size, size_t nitems, FILE * stream);int fclose( FILE *stream);Useful extras

You may find these useful:

  • fseek() : repositions the current read/write location.
  • feof() : tells you if the end-of-file is reached.
  • ftell() : returns the current read/write location.
  • ftruncate() : truncate a file to a specified length.
  • stat() : get file status

Files by example

Examples of using the file API as demonstrated in class, and beyond. Background on files and links to the interface specifications are provided below.

Write a simple array to a file#include <stdio.h>int main( int argc, char* argv[] ){ const size_t len = 100; int arr[len]; // put data in the array // … // write the array into a file (error checks ommitted) FILE* f = fopen( “myfile”, “w” ); fwrite( arr, sizeof(int), len, f ); fclose( f ); return 0;}Read a simple array from a file#include <stdio.h>int main( int argc, char* argv[] ){ const size_t len = 100; int arr[len]; // read the array from a file (error checks ommitted) FILE* f = fopen( “myfile”, “r” ); fread( arr, sizeof(int), len, f ); fclose( f ); // use the array // … return 0;}Write an array of structs to a file, then read it back#include <stdio.h>#include <stdlib.h>#include <string.h>typedef struct { int x,y,z;} point3d_t;int main( int argc, char* argv[] ){ const size_t len = atoi(argv[1]); // array of points to write out point3d_t wpts[len]; // fill with random points for( size_t i=0; i<len; i++ ){wpts[i].x = rand() % 100;wpts[i].y = rand() % 100;wpts[i].z = rand() % 100;} // write the struct to a file (error checks ommitted) FILE* f1 = fopen( argv[2], “w” ); fwrite( wpts, sizeof(point3d_t), len, f1 ); fclose( f1 ); // array of points to read in from the same file point3d_t rpts[len]; // read the array from a file (error checks ommitted) FILE* f2 = fopen( argv[2], “r” ); fread( rpts, sizeof(point3d_t), len, f2 ); fclose( f2 ); if( memcmp( wpts, rpts, len * sizeof(rpts[0]) ) != 0 )puts( “Arrays differ” ); elseputs( “Arrays match” ); return 0;}Saving and loading an image structure, with error checking

This example shows the use of a simple file format that uses a short “header” to describe the file contents, so that an object of unknown size can be loaded.

Make sure you understand this example in detail. It combines elements from the examples above into a simple but realistic implementation of a file format.

/* saves an image to the filesytem using the file format:[ cols | rows | pixels ]where:cols is a uint32_t indicating image widthrows is a uint32_t indicating image heightpixels is cols * rows of uint8_ts indicating pixel grey levels*/int img_save( const img_t* img, const char* filename ){ assert( img ); assert( img->data ); FILE* f = fopen( filename, “w” ); if( f == NULL ){puts( “Failed to open image file for writing” );return 1;} // write the image dimensions header uint32_t hdr[2]; hdr[0] = img->cols; hdr[1] = img->rows; if( fwrite( hdr, sizeof(uint32_t), 2, f ) != 2 ){puts( “Failed to write image header” );return 2; const size_t len = img->cols * img->rows; if( fwrite( img->data, sizeof(uint8_t), len, f ) != len ){puts( “Failed to write image pixels” );return 3; fclose( f ); return 0;}/* loads an img_t from the filesystem using the same format as img_save().Warning: any existing pixel data in img->data is not free()d.*/int img_load( img_t* img, const char* filename ){ assert( img ); FILE* f = fopen( filename, “r” ); if( f == NULL ){puts( “Failed to open image file for reading” );return 1;} // read the image dimensions header: uint32_t hdr[2]; if( fread( hdr, sizeof(uint32_t), 2, f ) != 2 ){puts( “Failed to read image header” );return 2; img->cols = hdr[0]; img->rows = hdr[1]; // helpful debug: // printf( “read header: %u cols %u rowsn”, // img->cols, img->rows ); // allocate array for pixels now we know the size const size_t len = img->cols * img->rows; img->data = malloc( len * sizeof(uint8_t) ); assert( img->data ); // read pixel data into the pixel array if( fread( img->data, sizeof(uint8_t), len, f ) != len ) { puts( “Failed to read image pixels” ); return 3; fclose( f ); return 0;}

Usage:

img_t img;img_load( &img, “before.img” );image_frobinate( img ); // manipulate the image somehowimg_save( &img, “after.img” );Task 1: Serialize an array of integers to a binary-format file

Extend the functionality of your integer array from Lab 5 to support saving and loading arrays from the filesystem in a binary format.

Fetch the header file “intarr.h”. It contains these new function declarations:

/* LAB 6 TASK 1 *//* Save the entire array ia into a file called ‘filename’ in a binary file format that can be loaded by intarr_load_binary(). Returns zero on success, or a non-zero error code on failure. Arrays of length 0 should produce an output file containing an empty array.*/int intarr_save_binary( intarr_t* ia, const char* filename );/* Load a new array from the file called ‘filename’, that was previously saved using intarr_save_binary(). Returns a pointer to a newly-allocated intarr_t on success, or NULL on failure.*/intarr_t* intarr_load_binary( const char* filename );/* LAB 6 TASK 2 *//* Save the entire array ia into a file called ‘filename’ in a JSON text file array file format that can be loaded by intarr_load_json(). Returns zero on success, or a non-zero error code on failure. Arrays of length 0 should produce an output file containing an empty array. The JSON output should be human-readable. Examples: The following line is a valid JSON array: [ 100, 200, 300 ] The following lines are a valid JSON array: [ 100, 200, 300 ]*/int intarr_save_json( intarr_t* ia, const char* filename );/* Load a new array from the file called ‘filename’, that was previously saved using intarr_save(). The file may contain an array of length 0. Returns a pointer to a newly-allocated intarr_t on success (even if that array has length 0), or NULL on failure.*/intarr_t* intarr_load_json( const char* filename );Submission

Commit the single file “t2.c” to your repo in the lab 6 directory.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Lab 6 Part 2 Stability Calculate Final Temperatures For Rising Or Sinking Air Pa

I have no idea how to work this page of my homework. I am really confused. Can someone please help me?

Lab 6 Part 2: StabilityCalculate final temperatures for rising or sinking air parcels.Calculate distances to cloud formation.Determine whether rising mir parcels are stable or unktalde.Define the term &quot;inversion.&quot;A rufioconde la sent skyward on a suemy day and observes the follow ing conditionsHeight aboveFeimperatureemand (miSarlike/ 0rom50372100013.30 17150014.515.52400131000410,000 149(18-F12A. Determine whether air at the ground is stable of unstable. To do this, do the following:List air from the ground to 500 m. and deternine its new temperature. Assume that netcondensation does not occur.500mCompare the temperature of the alt parcel to the temperature of air already at 500 in. Is the airparcel of the environment winner?Is air in the lowest layer of the atmosphere stable or unstable?213. Refer to the table above again. At whist layer of the atmosphere do we have a temperature inversion?Remember from lecture that a temperature inversion occurs when temperatures increase with height.1020. In a sentence or two, explain why temperature inversions are very stable.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Lab 6 Taxonomy Answer Key Pre Lab Questions 1 Use The Following Classifications 1

Lab 6: Taxonomy

ANSWER KEY

Pre-Lab Questions

1. Use the following classifications to determine which organism is least related out of the three. Explain your rationale. (1 pts)

The Eastern Newt is the least related organism out of the three. While all three are classified into the same domain, kingdom, phylum and class the Eastern Newt is in a different order than the American Green Tree Frog and the European Fire-Bellied Toad.

2. How has DNA sequencing affected the science of classifying organisms? (1 pts)

DNA sequencing has allowed for the comparison of genes at the molecular level as opposed to physical traits at the organism level. Physical traits can be misleading when classifying how related two organisms are. DNA sequencing can also trace relatedness through generations and more accurately assess how closely related two organisms are.

3. You are on vacation and see an organism that you do not recognize. Discuss what possible steps you can take to classify it. (1 pts)

The organism’s physical features can be used to compare it to known organisms. Some physiological features can even possibly be used to help classify it.

Cla

Experiment 1: Dichotomous Key Practice Level American Green Tree

Fro  g 

European Fire-

Bellied Toadinomial Name

 Table 3: Dichotomous Key Results

(2 pts each)

Post-Lab Questions

1. What do you notice about the options of each step as they go from number one up. (1 pt)

The options become more and more specific.

2. How does your answer from question one relate to the Linnaean classification system? (1 pts)

The dichotomous key options became more and more specific as they came closer to identifying the organism just like the classification system starts as a broad category (i.e, animal kingdom) and becomes more specific until a unique species is classified (i.e., species).

Experiment 2: Classification of Organisms

The flow chart questions will lead you to the correct classification of the organisms into their respective kingdoms. Table 2, shown above, has an error in your lab manual–sunflowers do not have motility. Most of you saw the discrepancy and went with the answer you got from the flow chart. For the blanks in the completed table (above), that’s because those answers are variable, and not necessary to identify that organism using the given flow chart. (3 pts)

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Lab 6 Taxonomy Answer Key Pre Lab Questions 1 Use The Following Classifications 2

Lab 6: Taxonomy

ANSWER KEY

Pre-Lab Questions

1. Use the following classifications to determine which organism is least related out of the three. Explain your rationale. (1 pts)

The Eastern Newt is the least related organism out of the three. While all three are classified into the same domain, kingdom, phylum and class the Eastern Newt is in a different order than the American Green Tree Frog and the European Fire-Bellied Toad.

2. How has DNA sequencing affected the science of classifying organisms? (1 pts)

DNA sequencing has allowed for the comparison of genes at the molecular level as opposed to physical traits at the organism level. Physical traits can be misleading when classifying how related two organisms are. DNA sequencing can also trace relatedness through generations and more accurately assess how closely related two organisms are.

3. You are on vacation and see an organism that you do not recognize. Discuss what possible steps you can take to classify it. (1 pts)

The organism’s physical features can be used to compare it to known organisms. Some physiological features can even possibly be used to help classify it.

Cla

Experiment 1: Dichotomous Key Practice Level American Green Tree

Fro  g 

European Fire-

Bellied Toadinomial Name

 Table 3: Dichotomous Key Results

(2 pts each)

Post-Lab Questions

1. What do you notice about the options of each step as they go from number one up. (1 pt)

The options become more and more specific.

2. How does your answer from question one relate to the Linnaean classification system? (1 pts)

The dichotomous key options became more and more specific as they came closer to identifying the organism just like the classification system starts as a broad category (i.e, animal kingdom) and becomes more specific until a unique species is classified (i.e., species).

Experiment 2: Classification of Organisms

The flow chart questions will lead you to the correct classification of the organisms into their respective kingdoms. Table 2, shown above, has an error in your lab manual–sunflowers do not have motility. Most of you saw the discrepancy and went with the answer you got from the flow chart. For the blanks in the completed table (above), that’s because those answers are variable, and not necessary to identify that organism using the given flow chart. (3 pts)

Post-Lab Questions

1. Did this series of questions correctly organize each organism? Why or why not? (2)

Yes. If the questions in the “tree” were answered correctly, each organism should end up in the correct kingdom.

2. What additional questions would you ask to further categorize the items within the domains and kingdoms (Hint: think about other organisms in the kingdom and what makes them different than the examples used here)? (2 pts)

Your answers will vary, but you should have brainstormed other organisms that belong to each domain or kingdom. For example, fish are also in the animal kingdom – how do fish differ from bears (gills instead of lungs, live in water, etc.)? What makes types of protists different from each other (shape, form of motion, etc.)?

3. What questions would you have asked of the ones that you answered about when classifying the organisms? (2 pts)

Answers will vary.

Example:

· Bacteria: Is it a membrane bound organelle?

· Fungi: Is it a yeast or mold?

· Plantae: Does it have a cell wall?

· Animalia: Is it multicellular?

· Protista: Is it a eukaryote, but, not an animal, plant, or fungi?

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW