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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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