Click here to Skip to main content
14,837,356 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Stuck in 2 loops Pin
Member 124990122-May-16 19:26
MemberMember 124990122-May-16 19:26 
Hey thank you for answer, I shared question originally and also how can identify your collection1.count and 2. yes should be like this.
Thank you


Voltage readings are obtained from an electrical substation once every hour for six hours (so there are six
readings).  Write a C program to perform the following checks on the substation:
a)	display all voltages that differ from the average by more than 10% of the average.
b)	display all pairs of consecutive hours where the change from the voltage at one hour
	to the next is greater than 15% of the average.


Example 1

Enter 6 voltages: 210.1 223.2 189.6 206.2 235.1 215.0
The average is 213.2 volts.
10% = 21.3 volts.
15% = 32.0 volts.

The following problems occurred:
1. Voltage at hour 3 was 189.6 volts (difference of 23.6 volts).
2. Voltage at hour 5 was 235.1 volts (difference of 21.9 volts).
3. Voltage change from hour 2 to hour 3 was 33.6 volts.


Example 2

Enter 6 voltages: 233.1 201.0 221.5 240.2 222.7 208.1
The average is 221.1 volts.
10% = 22.1 volts.
15% = 33.2 volts.

No problems were encountered.




I created project but when I put any think in for loops coming 11 "No problems were encountered"
or put under for loops this result coming sometimes with voltage results.
GeneralRe: Stuck in 2 loops Pin
Richard MacCutchan2-May-16 21:29
mveRichard MacCutchan2-May-16 21:29 
GeneralRe: Stuck in 2 loops Pin
Member 124990122-May-16 23:43
MemberMember 124990122-May-16 23:43 
QuestionRe: Stuck in 2 loops Pin
Parthiban.Appuswamy3-May-16 1:31
MemberParthiban.Appuswamy3-May-16 1:31 
AnswerRe: Stuck in 2 loops Pin
Member 124990123-May-16 1:36
MemberMember 124990123-May-16 1:36 
GeneralRe: Stuck in 2 loops Pin
Richard MacCutchan3-May-16 2:26
mveRichard MacCutchan3-May-16 2:26 
GeneralRe: Stuck in 2 loops Pin
Member 124990123-May-16 2:47
MemberMember 124990123-May-16 2:47 
GeneralRe: Stuck in 2 loops Pin
Richard MacCutchan3-May-16 2:55
mveRichard MacCutchan3-May-16 2:55 
AnswerRe: Stuck in 2 loops Pin
Patrice T4-May-16 23:24
mvePatrice T4-May-16 23:24 
GeneralRe: Stuck in 2 loops Pin
Richard MacCutchan5-May-16 0:26
mveRichard MacCutchan5-May-16 0:26 
GeneralRe: Stuck in 2 loops Pin
Patrice T5-May-16 0:52
mvePatrice T5-May-16 0:52 
GeneralRe: Stuck in 2 loops Pin
Richard MacCutchan5-May-16 1:08
mveRichard MacCutchan5-May-16 1:08 
Questiondotted rectangle is not being cleared if any empty string added in MFC comboboc Pin
Amrit Agr1-May-16 19:57
MemberAmrit Agr1-May-16 19:57 
AnswerRe: dotted rectangle is not being cleared if any empty string added in MFC comboboc Pin
leon de boer2-May-16 17:57
Memberleon de boer2-May-16 17:57 
QuestionCreation of class members of class created on the heap Pin
ForNow30-Apr-16 19:09
MemberForNow30-Apr-16 19:09 
AnswerRe: Creation of class members of class created on the heap Pin
Richard MacCutchan30-Apr-16 20:38
mveRichard MacCutchan30-Apr-16 20:38 
QuestionFIFO en languge C Pin
Member 1249381829-Apr-16 10:37
MemberMember 1249381829-Apr-16 10:37 
AnswerRe: FIFO en languge C Pin
Bram van Kampen29-Apr-16 11:48
MemberBram van Kampen29-Apr-16 11:48 
AnswerRe: FIFO en languge C Pin
Patrice T30-Apr-16 21:29
mvePatrice T30-Apr-16 21:29 
AnswerRe: FIFO en languge C Pin
CPallini1-May-16 20:49
mveCPallini1-May-16 20:49 
QuestionFour methods to create, pass to function and delete 2d arrays in c++ Pin
Javier Luis Lopez28-Apr-16 23:32
MemberJavier Luis Lopez28-Apr-16 23:32 
AnswerRe: Three methods to create, pass to function and delete 2d arrays in c++ Pin
Bram van Kampen29-Apr-16 12:27
MemberBram van Kampen29-Apr-16 12:27 
GeneralRe: Three methods to create, pass to function and delete 2d arrays in c++ Pin
Javier Luis Lopez29-Apr-16 23:05
MemberJavier Luis Lopez29-Apr-16 23:05 
AnswerRe: Three methods to create, pass to function and delete 2d arrays in c++ Pin
leon de boer29-Apr-16 18:01
Memberleon de boer29-Apr-16 18:01 
GeneralRe: Three methods to create, pass to function and delete 2d arrays in c++ Pin
Javier Luis Lopez29-Apr-16 23:08
MemberJavier Luis Lopez29-Apr-16 23:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.