Create a new c project in visual studio scroll down for mac


Lab Exercise Week 1 - Measuring CPU time

The following is a C++ program with code we will use throughout the course. Do the following:

1. Create a new C++ project in Visual Studio. (Scroll down for Mac version of this exercise.)

2. Copy and paste this program into Visual Studio.

3. Run the program with various limits. 50000 is a reasonable starting point.

4. Once you see the output, review the program to see what it does.

5. Research the Windows-specific data types and functions used in the program. (Use Microsoft web sites for this, not external sources.)

Homework 1 -

Run the CPUID program on your home PC or Mac. Turn in the following:

A description of your PC, Mac, or laptop. This should include the Intel processor model number, e.g. i7-4770K.

For PCs, include a full model description (e.g. HP Envy 700, Model No. 700-215xt). Research the PC or laptop specifics with Mr. Google. For laptops, you may need to look at the bottom. And a magnifying glass.

For Mac, include the model number (usually something like A1234) and research its specifications on everymac.com or a similar web site.

The output of the CPUID program.

Lab Assignment 5 -

This is the fifth lab assignment for this course.

The Problem - The United States Postal Service offers reduced rates for bulk mailers who follow their addressing requirements. One of these is to generate a machine-readable bar code on each envelope below the address. The Wikipedia article about PostNet explains the bar code. It includes a check digit, which you will also need to generate. We will not be generating the two Delivery Point digits.

Write a program to prompt the user for a nine-digit Zip+4 code. You should allow the user to enter a five-digit zip code, followed by the four- digit +4 portion. Your program should then generate a bit map with the appropriate PostNet-coded symbols, including the check digit. The background color should be white.

The size of the bit map depends upon the resolution of the printer used to put it on paper.

The printer in the room 1505 lab is an HP Lawerjet 4015p, which prints at a resolution of 1200 dots per inch. Thus, using the USPS standards above, our full height bars should be 1200 pixels times 0.125, or 150 pixels high, and the half bars should be 1200 times 0.05, or 60 pixels high. Bars should be 1200 times 0.02, or 24 pixels wide.

Bars should be spaced on roughly 54-pixel centers, so there should be 30 white pixels between each 24-pixel-wide bar.

As a result, the bar code bit map should be about 2900 pixels wide, and at least 160 pixels high - you should leave some white space at the top, bottom, and edges.

The bit map will be monochrome, but may be produced as a gray scale image like we did in lab 3.

Your output file should be named FMLLab5.bmp (i.e. the same naming convention as your program name), and must be placed in the C:\Temp directory.

There are several bar code generators on the internet, and you should use them to check your output.

Lab Assignment 6 -

Submit only one C++ file. any structs/classes should be in the file

The Problem - You are to search a bitmap in RGB format and count the number of pixels which match a set of colors. The bitmap will be 1024 by 1024 pixels for the purposes of explaining this problem. The set of colors will comprise 64 entries.

Input - You shall process a file named CS546.bmp (link is a zip file) located in the C:\Temp directory. Note that your program will be tested with different sized bit maps. You will also receive a file containing the 64 colors, formatted as three integer values in the range of 0 to 255 (for red, green, and blue), along with a color name. The color name is a string which may contain spaces and apostrophes.

Processing - Open the input files. Issue an appropriate error message and end the program execution if either open fails. Initialize CPU time and storage usage measurements. (See the lab exercises for CS546 weeks 1 and 6.) Read the color file and construct an appropriate container. (For example, an array of structures would be appropriate here. CS532 students may substitute a more sophisticated method.) Initialize the color array (or whatever technique is used) with the contents of the color file. Include an integer count initialized to zero for each entry. Read the bitmap array. For each pixel in the bitmap, determine if it matches one of the color entries. Maintain a count of the comparisons, matching or not. If it does, add one to the count associated with that entry. If it does not match any entries in the table, add one to a separate count of unmatched color entries.

Output - When all pixels in the bitmap have been evaluated, print out the color name and count of matches from the color array (or whatever other data structure you have chosen). Display the count of comparisons. Display the CPU time used and working storage set size.

Attachment:- Assignment Files.rar

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Create a new c project in visual studio scroll down for mac
Reference No:- TGS02798954

Expected delivery within 24 Hours