Member Avatar

Ok so i have trouble with looping with while and for statments heres the questions: 1. Write a program that gets a positive integer from the user and prints all the numbers from one to that integer. If the inputted number is zero or negative, then the program will print an error and quit. I dont have much, but this is all i have: [CODE]#include <iostream> using namespace std; int main() { int num=1, i; cout<<"please enter a number"<<endl; cin>>i>> while num<i; cout<< num+1<<; return 0; }[/CODE] Can someone please to me what to add and the correct format

Member Avatar
0
10
Member Avatar

Hello, Despite much searching, I've hit a wall with trying to get a varying number of records inserted into a database. Here's what I'm trying to do..... I'm building an online sign on site for races at a sailing club. For the sign on page, I want to make it possible for racers to sign on for either one or all the races happening on a day. Here's the form..... [CODE] <form action="" method="post" name="form1" id="form1"> <table align="center"> <tr valign="baseline"> <td nowrap="nowrap" align="right">Helm:</td> <td><select name="helm"> <option value="">Please Select....</option> <?php do { ?> <option value="<?php echo $row_sailors['name']?>"><?php echo $row_sailors['name']?></option> <?php } …

Member Avatar
0
8
Member Avatar

I TRY TO MAKE CODE COUNTER WITH CODE [B]MR/IR/001[/B] IN MY APPLICATION USING VISUAL BASIC 2008, BUT WHEN THE CODE GET [B]MR/IR/999[/B] IT`S STUCK AND NOT INCREASING, I WANT TO MAKE THE CODE INCREASE TO : MR/IR/1000 MR/IR/1001 MR/IR/1002 MORE AND MORE ... FOR DATABASE I`M USING MS ACCESS 2007 PLZ HELP ME... ------------------------------------------------------------------------------------ [code]Dim strTemp As String = "" Dim strValue As String = "" Dim sql As String sql = "SELECT * FROM DETAILPERIKSA ORDER BY IDPERIKSA DESC" cmd = New OleDbCommand(sql, Conn) dtReader = cmd.ExecuteReader If dtReader.Read Then strTemp = Mid(dtReader.Item("IDPERIKSA"), 7, 4) Else TxtDETAILTRANS.Text = "MR/IR/001" …

Member Avatar
0
10
Member Avatar

Hi All ~ So the program actually compiles without using arrays or global variables, outputs the correct user input, however average score and lowest score values that compute are wrong. I have no idea where the heck I'm messing up but I am hoping you can help me. The findLowest module works in that it outputs the last number entered by the user. calcAverge outputs the average of the last score alone. I guess I need to know where to put the accumulator for calcAverage and whether I should take a different approach altogether. I am soooooo.....close to having this …

Member Avatar
0
6

The End.