C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 15th, 2006, 03:15 AM
h4h4h1 h4h4h1 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 2 h4h4h1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 8 sec
Reputation Power: 0
Help with C++ -- max. value

hello everyone...


i am beginner in C++ and i need your help to determine the maximum value of results((how can i determine the maximum value of Y and print it with its corresponding values?))

......here is the program (sample run)
**********************************************


Welcome
Calculating a Trajectory Followed by a Projectile

Enter initial velocity [m/s]: 100
Enter initial angle [degree]: 60

Position and velocity
t x y vx vy
0.00 0.00 0.00 50.00 86.60
1.00 50.00 81.70 50.00 76.79
2.00 100.00 153.59 50.00 66.98
3.00 150.00 215.66 50.00 57.17
4.00 200.00 267.93 50.00 47.36
5.00 250.00 310.39 50.00 37.55
6.00 300.00 343.04 50.00 27.74
7.00 350.00 365.87 50.00 17.93
8.00 400.00 378.90 50.00 8.12
9.00 450.00 382.12 50.00 -1.69
10.00 500.00 375.53 50.00 -11.50
APEX:
t_max x_max y_max vx_max vy_max
9.00 450.00 382.12 50.00 -1.69

**********************************************

Reply With Quote
  #2  
Old March 15th, 2006, 03:58 AM
Cirus Cirus is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 276 Cirus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 11 h 48 m 58 sec
Reputation Power: 4
Quote:
Originally Posted by h4h4h1
hello everyone...


i am beginner in C++ and i need your help to determine the maximum value of results((how can i determine the maximum value of Y and print it with its corresponding values?))

......here is the program (sample run)
**********************************************


Welcome
Calculating a Trajectory Followed by a Projectile

Enter initial velocity [m/s]: 100
Enter initial angle [degree]: 60

Position and velocity
t x y vx vy
0.00 0.00 0.00 50.00 86.60
1.00 50.00 81.70 50.00 76.79
2.00 100.00 153.59 50.00 66.98
3.00 150.00 215.66 50.00 57.17
4.00 200.00 267.93 50.00 47.36
5.00 250.00 310.39 50.00 37.55
6.00 300.00 343.04 50.00 27.74
7.00 350.00 365.87 50.00 17.93
8.00 400.00 378.90 50.00 8.12
9.00 450.00 382.12 50.00 -1.69
10.00 500.00 375.53 50.00 -11.50
APEX:
t_max x_max y_max vx_max vy_max
9.00 450.00 382.12 50.00 -1.69

**********************************************


You can enlist the values of Y and sort them.There are several sorting algorithms available.

Keep track of position of max element in the original list and obtain values corresponding to that index numbers for other fields.

Reply With Quote
  #3  
Old March 20th, 2006, 04:22 AM
h4h4h1 h4h4h1 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 2 h4h4h1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 8 sec
Reputation Power: 0
Quote:
Originally Posted by Cirus
You can enlist the values of Y and sort them.There are several sorting algorithms available.

Keep track of position of max element in the original list and obtain values corresponding to that index numbers for other fields.


Thankx

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Help with C++ -- max. value


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT