<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Arrays question' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Arrays question' posted on the 'Beginner C/C++' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 18 May 2013 16:24:44 -0700</pubDate>
    <lastBuildDate>Sat, 18 May 2013 16:24:44 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Arrays question</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/430148/430148/arrays-question/</link>
      <description>C++ newb here. have this assignment and its driving me crazy. need some help. thanks.&lt;br /&gt;
&lt;br /&gt;
Arrays&lt;br /&gt;
Write a C++ program to perform the pseudo code listed below.&lt;br /&gt;
&lt;br /&gt;
Display message -  “***   This program was written by your name   ***” &lt;br /&gt;
Display message -   “   ***   This program features Arrays   ***”&lt;br /&gt;
Display message -   “Enter 5 numbers following each with Enter.”&lt;br /&gt;
Input to array variable		Use for loop here&lt;br /&gt;
Display message -   “The numbers you entered were:  a b c d e and f” //use for loop here&lt;br /&gt;
Display message -   “Enter one of the numbers above, and then enter the index that will display that number. ”&lt;br /&gt;
Input to variable&lt;br /&gt;
Input to  index variable&lt;br /&gt;
Display message -  “The number you entered was” X “does it equal this number? ” &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Output should look a lot like this.  Notice the “and” between the last two numbers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*** This program features arrays ***&lt;br /&gt;
&lt;br /&gt;
Enter 5 numbers following each number with enter&lt;br /&gt;
&lt;br /&gt;
22.3&lt;br /&gt;
15.4&lt;br /&gt;
33&lt;br /&gt;
52&lt;br /&gt;
32&lt;br /&gt;
the numbers you entered were: 22.3, 15.4, 33, 52, and 32&lt;br /&gt;
&lt;br /&gt;
Enter one of the numbers above and then enter&lt;br /&gt;
the index that will display that number&lt;br /&gt;
33&lt;br /&gt;
now enter the correct index&lt;br /&gt;
2&lt;br /&gt;
the number you entered was 33. does it equal this number? 33&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
press any key to continue.....&lt;br /&gt;
&lt;br /&gt;
I have the first part but i'm confused on how to make the second part work.&lt;br /&gt;
&lt;br /&gt;
Here is what i have so far..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
double values[5] = {0, 0, 0, 0, 0};&lt;br /&gt;
int main(){&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
int n;&lt;br /&gt;
double values[5];&lt;br /&gt;
&lt;br /&gt;
cout &amp;lt;&amp;lt;&lt;br /&gt;
" *** This program was written by        *** " &amp;lt;&amp;lt; endl &amp;lt;&amp;lt;endl;&lt;br /&gt;
cout &amp;lt;&amp;lt;&lt;br /&gt;
" *** This program features Arrays *** " &amp;lt;&amp;lt; endl &amp;lt;&amp;lt;endl;&lt;br /&gt;
cout &amp;lt;&amp;lt;&lt;br /&gt;
" Enter 5 numbers following each number with ENTER. " &amp;lt;&amp;lt; endl &amp;lt;&amp;lt;endl &amp;lt;&amp;lt;endl;&lt;br /&gt;
for(i = 0; i &amp;lt; 5; i++){&lt;br /&gt;
	cin &amp;gt;&amp;gt; values[i];&lt;br /&gt;
}&lt;br /&gt;
cout &amp;lt;&amp;lt; endl;&lt;br /&gt;
cout &amp;lt;&amp;lt;&lt;br /&gt;
"the numbers you entered were ";&lt;br /&gt;
for&lt;br /&gt;
&lt;br /&gt;
(i = 0; i &amp;lt; 4; i++) {&lt;br /&gt;
cout &amp;lt;&amp;lt; values[i] &amp;lt;&amp;lt;&lt;br /&gt;
", ";&lt;br /&gt;
}&lt;br /&gt;
cout &amp;lt;&amp;lt;&lt;br /&gt;
"and " &amp;lt;&amp;lt; values[4];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;
cout &amp;lt;&amp;lt; "Enter one of the numbers above and then enter the index that will display that number";&lt;br /&gt;
cin &amp;gt;&amp;gt; n;&lt;br /&gt;
for (i = 1; i &amp;lt;= n; i++) {&lt;br /&gt;
	values[i]++;&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
return 0;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/430148/430148/arrays-question/</guid>
      <pubDate>Wed, 07 Nov 2012 15:26:00 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
  </channel>
</rss>