rock9449 36 Light Poster

After clicking the label “Click Here,” a drop-down list is popped up to allow user to
select the shipping state, as shown in the picture on the next page

i am confused as to how to get the click here box to work and for the states drop down menu to be clicked on and appear rather then appear as a drop down can you please help?

here is all my code i have done so far it does compile but the last step is tricking me up ( i did download the asp.net toolkit also )


this is my aspx.cs seen below

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void TextBox1_TextChanged(object sender, EventArgs e)
    {

    }
}

default.aspx

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    <table class="style1">
        <tr>
            <td>
                Shipping State<asp:TextBox ID="TextBox1" runat="server" 
                    ontextchanged="TextBox1_TextChanged"></asp:TextBox>
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
                <table class="style1">
                    <tr>
                        <td>
                            <asp:DropDownList ID="DropDownList1" runat="server">
                                <asp:ListItem>New Jersey</asp:ListItem>
                                <asp:ListItem>New York</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    </form>
</body>
</html>
rock9449 36 Light Poster
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
 
        <asp:TextBox ID="TxtPassword" runat="server" 
            TextMode="Password" ontextchanged="TxtPassword_TextChanged1"></asp:TextBox>
        <asp:Label ID="Label1" runat="server" Text="Password"></asp:Label>
    
        <br />
       
  <asp:Label ID="Label2" runat="server"></asp:Label>

    </div>
    <p>
        &nbsp;</p>
    </form>
</body>
</html>

here is my event handler code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

        
       
        protected void TxtPassword_TextChanged1(object sender, EventArgs e)
        {
            Label2.Text = PasswordChar='';  [WHAT GOES HERE?]
        }
}

my problem is i forget what goves after the label2.text the purpose of the excersie is to enter a password have it be encrypted (got that so far) but the part i am confused in is having the password repeated back ex password *** so label 2 should read the password as what you typed in ex 123

rock9449 36 Light Poster

its not working

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

        
       
        protected void TxtPassword_TextChanged1(object sender, EventArgs e)
        {
            Label2.Text = false;  ?????
        }
}

what belongs here to get the password to show up what do i type for event handler i forget this part

rock9449 36 Light Poster

where do i put it in the code part i am confused?

rock9449 36 Light Poster

i am doing a project in class that you have to type in a password and have the password given back to you with astrixs which i did but the second part is i have to write an event handler that repeats the password back without the astriks here is my code so far

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

        protected void TxtPassword_TextChanged(object sender, EventArgs e)
    {

    }
}

i forget what i have to put in the txt password field to get it to display i already put a label in can u help me with the next step please?

<form id="form1" runat="server">
    <div>
 
        <asp:TextBox ID="TxtPassword" runat="server" 
            TextMode="Password" ontextchanged="TxtPassword_TextChanged"></asp:TextBox>
        <asp:Label ID="Label1" runat="server" Text="Password"></asp:Label>
    
        <br />
        <asp:Label ID="Label2" runat="server"></asp:Label>
    </div>
    <p>
        &nbsp;</p>
    </form>
</body>
</html>

here is other part in case you need it

rock9449 36 Light Poster

sorry i am not looking to spend money

Narue commented: +1 for being hilarious +36
rock9449 36 Light Poster

i am a bit confused on how to start this i have to write a for loop to read in 10 number , write bubble sort having 2 nested for loops and writing a loop to output to sorted array

int main ()
{	
	
		int total_neg=0;// intialize 
		int total_pos=0;
		int total=0;
		int num=0;
		int cnt=0;
		cnt=0;


		while ( cnt<10)//starting a while loop

{
		cout<<"enter an integer:";

		cin>>num;
	
		if	(num < 0)

{

		total_neg =total_neg + num;//declaring the formulas for the while loop
}
		else 
{
		total_pos = total_pos + num;
}

		total=total+num;

		cnt=cnt+1;


}
else
(
	 total_avg = total_pos+total_neg/10

}

		cout<<" total negatives are "<<total_neg<<endl;
		cout<<"total average is "<<total_avg<<endl;
		cout<<"total postives are "<<total_pos<<endl;
		cout<<"total of all numbers are"<<total<<endl;
		return 0;
}

i know how to convert the while to a for loop but i am having trouble implementing the psuedocode for a bubble sort into my program

the code i found was

int main()
procedure bubbleSort( A : list of sortable items ) defined as:
  do
    swapped := false
    for each i in 0 to length(A) - 2 inclusive do:
      if A[ i ] > A[ i + 1 ] then
        swap( A[ i ], A[ i + 1 ] )
        swapped := true
      end if
    end for
  while swapped
end procedure

any suggestions / help much appreciated

rock9449 36 Light Poster

thank you so much sir , how do you get so good at this is it just from reading or is it just constant coding or ?

rock9449 36 Light Poster

also it asks me to included a lopp that lets users inter in new value until they wish to end the program
how would that be done with a while loop that would let the user enter in a value or a letter to quit the program?

rock9449 36 Light Poster

because i am getting complier errors when added onto my new code

#include <iostream>
using namespace std;


void input(int& hours, int& minutes);
void output(int hours, int minutes, char type);
int convertTo12Hour(int hours, char& type);

int main() {
  int hours;
  int minutes;
  char type;
  char answer;
 
  do
   {
    input(hours, minutes);
    hours = convertTo12Hour(hours, type);
    output(hours, minutes, type);

    cout << "Perform another calculation? (y/n): ";
    cin >> answer;

    } while ((answer == 'Y') || (answer == 'y'));

  return 0;
}
 
void input(int& hours, int& minutes) {
  cout << "Enter the hours for the 24 hour time: ";
  cin >> hours;
  cout << "Enter the minutes for the 24 hour time: ";
  cin >> minutes;
 }
//
// Displays a time in 12 hour notation
//
void output(int hours, int minutes, char type) {
  cout << "The time converted to 12 hour format is: " << hours << ":";  
  //
  // special handling for leading 0s on the minutes
  //
  cout.width(2);
  cout.fill('0');
  cout << minutes;
  //
  if (type == 'A')
    cout << " A.M." << endl;
  else
    cout << " P.M." << endl;
 }
 
   
      void Convert( int& hours )
   
      {
   
      hours = hours % 12;
   
      }
	  if( hours < 12)
{
    pm = 'A';
}
else
{
    hours -= 12;
    pm = 'P';
}

errors
Error 1 error C2059: syntax error : 'if'
Error 2 error C2143: syntax error : missing ';' before '{' 65 lab4
Error 3 error C2447: '{' : missing function header (old-style formal list?) 65 …

rock9449 36 Light Poster

im getting errrors associated with that column

rock9449 36 Light Poster
void Convert( int& hours )
   
      {
   
      hours = hours % 12;
   
      }
	  
	  if( hours < 12)
{
    pm = 'A';
}

	  else;
{
    hours -= 12;
    pm = 'P';
}
rock9449 36 Light Poster

yes almost but i think the if else syntax is wrong?

rock9449 36 Light Poster

yeah i see the problem that's why i think its giving me a compiler error so after the convert statement i think i need an if else statement to tell it to differentiate between AM or Pm

rock9449 36 Light Poster

Error 1 error LNK2019: unresolved external symbol "int __cdecl convertTo12Hour(int,char &)" (?convertTo12Hour@@YAHHAAD@Z) referenced in function _main lab4.obj lab4
Error 2 fatal error LNK1120: 1 unresolved externals C:\Documents and Settings\oml5000\My Documents\Visual Studio 2008\Projects\lab4\Debug\lab4.exe lab4


it almost works but im still getting two compiler errors something with regards to my conversion

rock9449 36 Light Poster

using an if else statement but what function i call i can put it in words but that's where i have a hard problem putting it into code
i know it would be something like
if hours < 12
pm = 12- hours ?
cout>>pm?

rock9449 36 Light Poster

where do i insert this into my code perhaps i outdid myself and should start all over , am i on the right track?

rock9449 36 Light Poster

I need help in writing a C++ program that converts 24-hour notation to 12-hour notation. (For example, it should convert 14:25 to 2:25 P.M. The input is given as two integers. There are three functions: one for input, one to do the conversion, and one for output. Record the A.M./P.M. information as a value of type char, 'A' for A.M. and 'P' for P.M. Thus, the function for doing the conversions will have a call-by-reference formal parameter of type char to record whether it is A.M. of P.M. ) Specifically, I need help iin defining the function : int convertTo12Hour(int hours, char& type)
The code I have so far is:

#include <iostream>
using namespace std;


void input(int& hours, int& minutes);
void output(int hours, int minutes, char type);
int convertTo12Hour(int hours, char& type);

int main() {
  int hours;
  int minutes;
  char type;
  char answer;
 
  do
   {
    input(hours, minutes);
    hours = convertTo12Hour(hours, type);
    output(hours, minutes, type);

    cout << "Perform another calculation? (y/n): ";
    cin >> answer;

    } while ((answer == 'Y') || (answer == 'y'));

  return 0;
}
 
void input(int& hours, int& minutes) {
  cout << "Enter the hours for the 24 hour time: ";
  cin >> hours;
  cout << "Enter the minutes for the 24 hour time: ";
  cin >> minutes;
 }
//
// Displays a time in 12 hour notation
//
void output(int hours, int minutes, char type) {
  cout << "The time converted to 12 hour format is: " << hours << ":";  
  //
  // special handling …
rock9449 36 Light Poster

thanks your help i will ask the instructor for further clarification while i do know about arrays and loops this is the second lab for the course and hasnt covered that material so i am not sure how advanced he wants this lab to be

rock9449 36 Light Poster
if (num1>0 && num2>0 && num3> &&num4>0 &&num5>0 &&num6>0 &&num7>0 &&num8>0 &&num9>0 &&num10>0              );//an if statement stating that if the number is greater then 0 or less then zero to show how much greater or less than it is
{	
	answer3=num1+ num2+num3+num4+num5+num6+num7+num8+num9+num10;
	cout<<"the sum of all positives" <<answer3<<endl;
}

	else 
		
		(num1>0 && num2>0 && num3> &&num4>0 &&num5>0 &&num6>0 &&num7>0 &&num8>0 &&num9>0 &&num10>0 );
	{
	answer4=num1+ num2+num3+num4+num5+num6+num7+num8+num9+num10;
	cout<<"the sum of the negatives greater than 0 is"<<answer4<<endl;
	}
	return 0;
}

illegal syntax and illegal if/else did i put this in right?

rock9449 36 Light Poster

first i was thinking the if else judgment should before the answer and answer1.
and the answer and answer1 is the else
then everything are int, so if i input number1=2.1
it will cause problem

im not really sure what you are asking me to change to make this correct

rock9449 36 Light Poster

in C++ i am getting two errors regarding illegal else without matching if , and i have dont i myself the last step of my project is to obtain the average of all non positive numbers and average of all negative numbers as well as the sum of just the negatives

1- am i doing this write in theory if i create 2 if statements that if the numbers are less then 0 just take the average of those thus the reason for declaring answer3 /4

even though i am having errors is my algorithm right?

#include <iostream>
using namespace std;

int main ()
{	
	
	int num1,num2,num3,num4,num5,num6,num7,num8,num9,num10,answer,answer1,answer3,answer4;//declaring the numbers as intigers
	cout<<"this program will have you input in 10 whole numbers.\n";
	cout<<"please enter in ten whole numbers followed by a comma";//asking you to input the numbers
	cout<<"enter in num1.\n";//enter in the numbers
	cin >> num1;
	cout<<"enter in num2.\n";
	cin >> num2;
	cout<<"enter in num3.\n";
	cin >> num3;
	cout<<"enter in num4.\n";
	cin >> num4;
	cout<<"enter in num5.\n";
	cin >> num5;
	cout<<"enter in num6.\n";
	cin >> num6;
	cout<<"enter in num7.\n";
	cin >> num7;
	cout<<"enter in num8.\n";
	cin >> num8;
	cout<<"enter in num9.\n";
	cin >> num9;
	cout<<"enter in num10.\n";
	cin >> num10;
	answer=num1+num2+num3+num4+num5+num6+num7+num8+num9+num10;//formula to get the sum of the number
	cout<<"the sum of the ten numbers are"<<answer<<endl;
	answer1=(num1+num2+num3+num4+num5+num6+num7+num8+num9+num10)/10;
	cout<<"the average is"<<answer1<<endl;

	if (num1,num2,num3,num4,num5,num6,num7,num8,num9,num10 < 0);//an if statement stating that if the number is greater then 0 or less then zero to show how much greater or less than it is …
rock9449 36 Light Poster

thank you i fixed that and now i am getting an error that says answer is not being initalized when i get it to run and key in my selection?

#include <iostream>
using namespace std;

int main ()
{	
	int choice,num1,num2,answer;
	cout<<"This is a caculator program which will do math for you\n";
	cout<<"Please Choose From one of 4 math operators\n";
	cout<<"1 +\n";
	cout<<"2 *\n";
	cout<<"3 -\n";
	cout<< "4 \\\n";  
	cin>>choice;
if (choice==1)
{
	cout<<"please enter in two numbers to add" <<answer<<endl;
	cin>>num1;
	cout<<"you entered"<<num1<<endl;
	cin>>num2;
	cout<<"you entered"<<num2<<endl;
	answer=num1+num2;
	cout<<"the answer is "<<answer<<endl;
}
else if(choice==2)
{
	cout<<"please enter in two numbers to multiply" <<answer<<endl;
	cin>>num1;
	cout<<"you entered"<<num1<<endl;
	cin>>num2;
	cout<<"you entered"<<num2<<endl;
	answer=num1*num2;
	cout<<"the answer is "<<answer<<endl;
}
else if (choice==3)
{
 
cout<<"please enter in two numbers to subtract" <<answer<<endl;
	cin>>num1;
	cout<<"you entered"<<num1<<endl;
	cout<<"num1/\n";
	cin>>num2;
	cout<<"you entered"<<num2<<endl;
	answer=num1-num2;
	cout<<"the answer is "<<answer<<endl;
	
}
 else if(choice==4)

 
cout<<"please enter in two numbers to divide" <<answer<<endl;
	cin>>num1;
	cout<<"you entered"<<num1<<endl;
	cin>>num2;
	cout<<"you entered"<<num2<<endl;
	answer=num1/num2;
	cout<<"the answer is "<<answer<<endl;

	
return 0;
}
rock9449 36 Light Poster
#include <iostream>
using namespace std;

int main ()
{	
	int choice,num1,num2,answer;
	cout<<"This is a caculator program which will do math for you\n";
	cout<<"Please Choose From one of 4 math operators\n";
	cout<<"1 +\n";
	cout<<"2 *\n";
	cout<<"3 -\n";
	cout<<"4 \\n";
	cin>>choice;
if (choice==1)
{
	cout<<"please enter in two numbers to add" <<answer<<endl;
	cin>>num1;
	cout<<"you entered"<<num1<<endl;
	cin>>num2;
	cout<<"you entered"<<num2<<endl;
	answer=num1+num2;
	cout<<"the answer is "<<answer<<endl;
}
else if(choice==2)
(
	cout<<"please enter in two numbers to multiply" <<answer<<endl;
	cin>>num1;
	cout<<"you entered"<<num1<<endl;
	cin>>num2;
	cout<<"you entered"<<num2<<endl;
	answer=num1*num2;
	cout<<"the answer is "<<answer<<endl;
	)
else if (choice==3)
(
 
cout<<"please enter in two numbers to subtract" <<answer<<endl;
	cin>>num1;
	cout<<"you entered"<<num1<<endl;
	cout<<"num1/\n";
	cin>>num2;
	cout<<"you entered"<<num2<<endl;
	answer=num1-num2;
	cout<<"the answer is "<<answer<<endl;
	
	)
 else if(choice==4)

 
cout<<"please enter in two numbers to divide" <<answer<<endl;
	cin>>num1;
	cout<<"you entered"<<num1<<endl;
	cin>>num2;
	cout<<"you entered"<<num2<<endl;
	answer=num1/num2;
	cout<<"the answer is "<<answer<<endl;

	
return 0;
)

i know i am doing something wrong with the if else statements but i cant figure out what it is the program seems to look right but its giving me errors such as illegal else/if and syntax errors i know overall it is almost there if someone can guide me through the last part i would appreciate it greatly

rock9449 36 Light Poster

sorry maybe i should be more specific the program runs but there is an error in credit as it does not allow me to input a number to be passed by reference

also can somone evaluate if my functions are working the way they should be by pass by reference and value returning ?

// i have not made any changes to the original code post as post 2 was very vauge as to what i had to exactly change

rock9449 36 Light Poster

i apreciate that help but that extra step isnt necessary as for my project on the code above do my functions work the way they are supposed to ?
one by pass by refrence which is course
and the other which is num students a value returning function

also when i post this code it doesnt compile what is going wrong?

rock9449 36 Light Poster

it is supposed to be a assingment dealing with functions
these are the fucntions that i am suppposed to create
fn= function

number of students in the class (value-ret fn)

Information for the 3 courses you took: (pass by reference fn)

The course name (without spaces)
The number of credits
Grade value (decimal number)
Calculate the total GPA for each student. (use a fn)

Calculate the letter grade using the ranges defined below. (use a fn)


but i am not sure if my first 2 functions which i have the code for posted the one regarding student number and the course name is done correctly or not and am geting build errors

rock9449 36 Light Poster

i am having a hard time writing programs that can read from a text file it should read beginning balance, number of transactions and description and amount after each but i am having trouble

ex : sample input
beginning balance=260.80
number of transactions =4
transactions:
check-mallsounds -31.98
check-Atlantic 127.04
deposit- work 25.00
check-boskovs -65.70
output
checkmallsounds 31.98 228.82

i am not asking for someone to write the code for me as i want to learn how to do this myself but perhaps someone can give me a boost in terms of the code for initiating the read from and output to text file part

rock9449 36 Light Poster

how do i fix this then so that the functions that i declared work properly

rock9449 36 Light Poster

i am trying to write code for my function project but i get errors can somone tell me if i am on the write track at least

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
//fn prototype for passing num of students in class 
// *** void DisplayStudent(double num, double answer); ???
void DisplayStudent(double num);
// *** void DisplayName(string& courseName,double answer);
void DisplayName(string& courseName,string& answer);
void DisplayCredit(double& credit,double& answer1);
// *** int main ()
int main() 
{
//*** double num,answer;
double num;
string answer;
string courseName;
double credit;
cout << "Enter the total number of students in each class \n";
cin >> num;
//first call then bounces too loop

//function call
// *** DisplayStudent(answer,num);
DisplayStudent(num);
DisplayName(courseName,answer);

cout<<"the amount of credits is   "<<&credit<<endl;
cout << "The course you are taking is   " << courseName<<endl;
return 0;
}
//function goes here
// *** void DisplayStudent(double num,double answer)
void DisplayStudent(double num)




{ 
// *** cout<<" the total number of students=" << answer;
cout<<" the total number of students=" << num<<endl;
}

void DisplayName(string &courseName,string& answer ) 
{
cout << "what course please enter without spaces" << answer<<endl;
cin >> courseName;
}

the functions should include pass by reference for course name and number of credits
and if possible include a function on how to caculate a gpa