Create a new C++ project in Visual Studio

Assignment Help Programming Languages
Reference no: EM132004490

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

Reference no: EM132004490

Questions Cloud

What must the cfo have expected about change : What must the CFO have expected about change in the value of the British pound over the year to believe in March, 2016 that investment in 1year.
Firms participating in strategic alliances : What benefits may accrue to firms participating in strategic alliances? What are the potential limitations and pitfalls?
Do you agree or disagree with statement : Support your answer with examples of how quality should be defined and how the Kano model links to customer expectations.
Limitations of planning highlighted by mintzberg : According to Mintzberg's Strategic planning is an oxymoron, why? Is there any limitations of planning highlighted by Mintzberg?
Create a new C++ project in Visual Studio : Create a new C++ project in Visual Studio. (Scroll down for Mac version of this exercise.) Copy and paste this program into Visual Studio
How low could the resale value of the fiasco be to provide : Alternative B is a foregin-built Fiasco. its initial cost is $8000, the operating cost,also excluding depreciation, is $0.08/km.
Student perceptions of their writing skills : Student Perceptions of Their Writing Skills: Myth and Reality," by Mark Simkin, Janna Crews and Mary Groves (Journal of Business & Management.
Responsibilities do employers and employees : What responsibilities do employers and employees have in such circumstances?
Understand some ways to increase effectiveness : Help me understand how Apple can use social media to leverage its digital strategy?

Reviews

len2004490

6/1/2018 7:14:03 AM

Lab 5 and MSPLab5.cpp included to possibly help with solution in c++ w/ some assembly instructions. Homework, Reading, and Related Tasks - Download the three volumes of Intel reference manuals discussed in class. Run the CPUID program on your home PC. See details below. (Click here for the Mac version.) Practice your hexadecimal if necessary. Read the Wikipedia article about Amdahl's Law. Read chapter 1 in the course text.

len2004490

6/1/2018 7:13:53 AM

This is the fifth lab assignment for this course. It is due no later than Tuesday, 29, by 11:59 PM. You will submit it through a Canvas upload. This assignment will use some of the bit map creation skills you used in lab assignment 3. There will be another option for lab assignment 5. The naming convention specified for this assignment is to use your initials (three letters please), the word Lab, and the digit 5 for this assignment. Use 'X' if you do not have a middle name or last name. Thus, if W.C. Fields were taking this class and turning in this lab, he would provide a file named WCFLab5.cpp. If Madonna were taking this class, her lab would be MxxLab5.cpp. Only turn in the program source ?le, i.e. the C++ source code with embedded Intel assembler code. You should use Intel assembly code to generate each digit's bit map. Grading Standards - Successful display of input values as a bit map: 7 points, Successful compile by the instructor: 2 points and Correct naming standards followed: 1 point.

len2004490

6/1/2018 7:13:47 AM

Grading - Six factors affect the grade you receive on this project: Correct program naming, file and directory name usage, and successful compile - 1 point. If your program does not meet these criteria, there may not be time for me to grade it. Accuracy of the pixel color count - ten points. CPU time used - 1 to three points - three points for the single best, one point for the single worst, and two points for everything in the middle. Number of comparisons - The theoretical worst case with a 1024x1024 bitmap and 64 colors is 67,108,864 comparisons. The best case for this bitmap size is 1,048,576 comparisons. Three points will be awarded for the single best (lowest) number of comparisons, one point for the single worst, and two points for everything in the middle. Working set (storage) size - two points for the best (lowest) storage utilization, zero points for the worst, and one point for everything in the middle.

len2004490

6/1/2018 7:13:41 AM

Note that use of a sixteen-megabyte array which uses the RGB color as a direct index will automatically receive zero points. Coding that as a two-megabyte bit map might escape this fate. Then again, it might not. Elegance of solution - An arbitrary number of points may be added to your score based upon this and/or another instructor's assessment of your algorithm choice, design, and implementation. Note that use of a sixteen-megabyte array which uses the RGB color as a direct index will automatically receive zero points. Or maybe a negative number if we are feeling surly.

Write a Review

Programming Languages Questions & Answers

  Make a note of how many records that were deleted

Save your SQL query as SQLQuery1D3 and execute the statement.

  Program read data from input file and select specified items

Program should be able to read data from input file and select the specified items. Write data for school-age males to file male.out and data for school-age females to female.out.

  Create an order class constructor that takes parameters

Create a class named Order that performs order processing of a single item that sells for $19.99 each.

  Program to permit company-s clerks to enter employee-s name

Temp Employers wants program which will permit company's clerks to enter employee's name and number of hours employee worked during month.

  Create a program that has an object type of contact

Create a program that has an object type of Contact. This contact will need to have the following attributes: Name, Birth Date, Phone Number, Address and Eye Color

  Identify the errors

Identify the errors in the following program segment. Determine the output displayed when the button is clicked:

  Write a dim statement that declares a myfriend variable name

Write a Dim statement that declares a MyFriend variable named school. Write an assignment statement that assigns the value in the txtFirst control to the strFirst member.

  Give hypertext link of the internet location of program

Describe in one or two paragraphs what you observe. Give hypertext link of the internet location of the program (or applet) you found.

  Write program that stores this information in a two-d array

Write a program that stores this information in a two dimensional 3 × 7 array, where each row represents a different monkey and each column represents a different day of the week.

  Create class to calculate perimeter and area rectangle

Create class Rectangle. The class has attributes length and width, each of which defaults to 1. It has read-only properties that calculate the Perimeter and the Area of the rectangle.

  Write code to takes input from console

Write code using C++ which takes input from console and displays output on console. You will write program which takes user input, does some basic arithmetic, and displays the results.

  Application development and programming languages

Application Development and Programming Languages,  Programming languages have evolved since the First Generation Languages (1GLs) in the 1940s. The 1GLs were machine languages, which interacted directly with hardware. 2GLs were assembly languages. F..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd