Create a pointer structure that has members

Assignment Help Computer Engineering
Reference no: EM132153454

I am having trouble with the creating the following program in C programming. Please check to make sure the answer is correct because I have had some issues recently with programs provided not working properly. Please make it as simple and basic as possible. Here is the program I need help with:

Create a pointer structure that has members for the x and y coordinates. Use typedef to make a point_t data type. Create a rectangle structure that has a point_t member for the upper left corner of the rectangle, but also a float for the height and a float for the width. Use typedef to make a rectangle_t data type.

Create a function called is_in() that takes in a point_t variable and a rectangle_t variable, both by reference, and returns 0 if the point is not in the rectangle and 1 if the point is in the rectangle.

Use computer science y-axis (i.e., the origin is in the upper left corner of the screen and y values increases further down the screen).

Write a program that gets a point from the user and the point for the upper left corner and dimensions of a rectangle and then tells whether the point is in the rectangle or not.

Sample Runs:

Enter a point (x and y): 0.0 0.0

Enter a rectangle (x, y, width, and height): -50.0 -50.0 100.0 100.0

Point is inside the rectangle

Enter a point (x and y): 200.0 200.0

Enter a rectangle (x, y, width, and height): -50.0 -50.0 100.0 100.0

Point is outside the rectangle

Reference no: EM132153454

Questions Cloud

What if the size of the usb flash drive is increased : You also have an LTE data card that connects to your portable computer and receives data any where you're located at a rate of 50 Mbps.
Regarding the effects of a soda tax on other people : Setting self-interest to one side, what is your opinion regarding the effects of a soda tax on other people?
Why twitter is a unidirectional network and facebook is not : The tributaries of the Mississippi River follow a Power Law. Can you explain which variables should go on each axis?
Discuss about the multidimensional arrays : We need to start with the types of C++ tasks that should be included in the final project. We have true multidimensional arrays to work with now.
Create a pointer structure that has members : Create a pointer structure that has members for the x and y coordinates. Use typedef to make a point_t data type.
Why cache memory is faster than main memory : List four types of memory (storage) in the computer memory hierarchy. What is locality principle?
Calculate the opportunity cost : Calculate the opportunity cost and show the answer and the calculation. Should the company ask Bill to make the extra clutches or not?
Relationship between the current accounts of the two : What relationship between the current accounts of the two countries is satisfied when the world real interest rate is at its equilibrium value?
How much fuel they will burn when planning a road trip : A travel smart phone app wants to help people approximate how much fuel they will burn when planning a road trip and also how much that will cost

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is the loop invariant for the for loop in this code

Problem A: Given an integer array a[], with size "size", and size>0, the following code gives the index of a largest element in the array.

  Write a private statement that declares a 10-element

Create a VB.Net Windows Form application named ComputerProject_YourName. Change the name property of your form to frmMain.

  What implications does queues have for the mach scheduler

Each of the global run queues has a single mutex for locking it. What implications does this have for the Mach scheduler?

  Assume a direct access file consists of sectors

assume a direct access file consists of sectors with 1024 byte capacity. Suppose also that records are 32 bytes long. On which logical sector do the following logical records lie? What is the relative record number in the sector?

  Sketch a diode transistor nand circuit

Sketch a diode-transistor NAND circuit and explain the operation of the circuit. - Explain the concept of minimum β and the purpose of the pull-down resistor.

  Write the operation table for boolean operation and

Write the operation table for Boolean operation AND. Write the operation table for Boolean operation OR. Write the operation table for Boolean operation NOT.

  Use the web to research and evaluate security products from

in a two-page apa formatted paper provide analysis answering the followinguse the web to research and evaluate security

  Why will bright pixel tracing function only work in darkness

Will the bright pixel tracing function only work in darkness? Make your own movie with someone writing with a glow stick or flashlight, in normal brightness.

  Prepare storyboards that show the proposed screens

Prepare storyboards that show the proposed screens, including at least two sublevel tasks for each action.

  What types of instructions would not utilize fourth address

In a four-address machine, the fourth address in the instruction corresponds to the address of the next instruction to be fetched.

  How to defend against attacker on the web

Even just talking on the phone can be a security risk, according to Harwood, there will be a slight increase in risk due to all the vulnerabilities

  Are encryption backdoors necessary for good security

Are encryption backdoors necessary for good security national security? If so, how should they be managed to ensure a malicious party can't use them?

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