Question: This assignment requires you to write a program in C + + with inline assembly. Turn in your program via a Canvas submission. Only turn

This assignment requires you to write a program in C++ with inline assembly.
Turn in your program via a Canvas submission. Only turn in the program source file, i.e. the .cpp source code with embedded assembly.
Your program should start with the following heading:
; Lastname, Firstname CS230 Section 11185 Date completed
; Lab 3- Map Boundaries
The Problem
Use the bit map creation program from the week 5 lab exercises as a base, along with your lab 2 program (Bresenham's algorithm), to draw lines in a bit map which provide a geographic map outline. This will only be accepted as an individual assignment.
To simplify your life, convert the salient parts of your lab 2 submission into a function called lineTo.
Input
After creating the basic bit map (1024 by 1024 pixels), your program will read a text file which contains pairs of longitude and latitude numbers (in that order). These values will be positive, and will be within the following dimensions:
North - maximum latitude =38.995110
West - maximum longitude =-77.119900
South - minimum latitude =38.791513
East - minimum longitude =-76.909395
(For longitude, maximum and minimum are relative to their absolute value.)
The text file is at this link. It is called DCBoundaryFile.txt and it is in the Assignments folder of our Canvas course.
Processing
Start by creating the bit map in storage. Read the first two entries from the input file. Verify that all values are within the east/west or north/south ranges above. Ignore any points which are not and issue message 3 if any values are out of range, then end the program.
Save the first longitude and latitude values as separate variable for later use.
For each point (pair of longitude/latitude values), calculate the equivalent x or y pixel position. To do this:
subtract the edge boundary (south for latitude and east for longitude) from the longitude or latitude.
divide the difference by the number of degrees per pixel in the bit map. For our assignment, use 0.00019883 for that value.
the quotient becomes the x or y position. Truncate the result (you may use the math floor function.)
These calculations must be in Intel assembly language. The rest of the program can be in C++.
Read in the next pair of long/lat values. Calculate the equivalent x and y values. Then call the lineTo() function to draw that line segment. After drawing, use the newest point as the "from" point for the next segment, and read in the new longitude and latitude values.
Putting it another way, you may find it simplest to define four variables named x1, y1, x2, and y2. After drawing the line, copy x2 into x1, and y2 into y1, then proceed with the next point, placing those values into x2 and y2.
Your program should end by comparing the most recently read long and lat values to the first long and lat values. If they are equal, stop the program. (Remember from CS116 that direct equality of floating point values may not be a successful test.) Write the output bit map and invoke Paint to display it, then end the program.
Output
Message 1:
Pierce College CS230 Spring 2024 Lab Assignment 3- Last, first
Replace Last, first with your name.
(No message 2.)
Message 3:
Value nnnn out of range, ending.
Replace nnnn with the incorrect value. Note that all four values must be checked, so message 3 may be issued up to four times.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!