Jump to content

help on these programs

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1
jaymark

jaymark

    Newbie

  • Members
  • Pip
  • 7 posts
Create a file that includes information on milk yield. The structure of the record:
- Name milkmaids;
- The yield from each of 5 cows.
Determine the average milk yield for each of milkmaids and select the three best milkers. Output display. Number of records> 10.
3. Write a program that solves the problem with the use of sub-type function, procedure: determine the amount of elements of main and side diagonals of the matrix A (N, N), B (M, M). The matrices A, B - bring in the conventional form.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
What do you have so far?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
jaymark

jaymark

    Newbie

  • Members
  • Pip
  • 7 posts
I got an exam

#4
julmuri

julmuri

    Programmer

  • Members
  • PipPipPipPip
  • 139 posts
Good for you. :D
std::string s("oberq zhpu?");std::for_each(s.begin(),s.end(),[&](char&c){c=~c;c=~c-0x01/(~(c|0x20)/0x0D*0x02-0x0B)*0x0D;});std::cout<<s;

#5
jaymark

jaymark

    Newbie

  • Members
  • Pip
  • 7 posts
je ne comprend rien a cela

#6
jaymark

jaymark

    Newbie

  • Members
  • Pip
  • 7 posts
I don't know how to that...I'm studying in ukraine and it's hard...

#7
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Let me clarify: we don't do homework for you, so unless you can indicate what you have so far, or what part doesn't make sense, there isn't a lot we can do to help.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#8
jaymark

jaymark

    Newbie

  • Members
  • Pip
  • 7 posts
program lab2;
type
  nadoiInfo=record
    name:string[10];
    nadoi:string[5];
    kar:array[1..50] of byte;
  end;
var
  f:file of nadoiInfo;
  st:nadoiInfo;
  p:byte;
  procedure lab1;
begin
  assign(f,'nadoi.dat');
  {$I-} 
  reset(f); 
  {$I+}
  if ioresult<>0 then
  begin
    writeln('fail s danimi ne naydion. zapustit snachala pervuyu programu');
    exit; 
  end;
  with st do
  repeat
    read(f,st); 
    writeln('imya nadoi: ',name);
    write('kar:',kar);
    for p:=low(malok) to high(malok) do
      write('ckolka litrov malaka za sutki',p,': ',malok[p]);
  until eof(f); 
  close(f); 
  end;
  procedure efect2;
  
begin
  assign(f,'nadoi.dat');
  {$I-} {Áóäåì ñàìè îòñëåæèâàòü îøèáêè}
  reset(f); {Îòêðîåì ôàéë. Ïîçèöèÿ íà äàííûé ìîìåíò â ñàìîì íà÷àëå}
  {$I+}
  if ioresult<>0 then rewrite(f); {Åñëè îøèáêà, çàí÷èò ôàéëà íåò, è çíà÷èò îòêîåì åãî ïîäðóãîìó}
  seek(f,filesize(f)); {Åñëè ìû îòêðûëè ôàéë ïåðâûì ñïîñîáîì, òî çíà÷èò îí óæå áûë è çíà÷èò òàì
                        åñòü çàïèñè. Ñëåäîâàòåëüíî  ïåðåìåñòèìñÿ â åãî êîíåö ÷òîáû äîïèñûâàòü ñòóäåíòîâ}
  with st
  do repeat
    write('vvedit nadoi(pustuyu ctroku dla vihoda): ');
    readln(name);
    if name='' then break;
    write('vvedit karova:');
    readln(kar);
    for p:=7 to 15 do
    begin
      write('vvedit litre malaka po nadoi',p,': ');
      readln(ekz[p]);
    end;
    write(f,nd); {Âîò ýòà ñòðîêà è çàïèñûâàåò èíôîðìàöèþ î ñòóäåíòå â ôàéë}
  until false;
  close(f); {Ýòó êîìàíäó ìû åù¸ íå ðàññìàòðèâàëè, íî îá ýòîì ÿ ðàññêàæó â êîíöå}
end;
begin
lab1;
efect2;
readln;
end.

Edited by WingedPanther, 23 May 2010 - 01:48 PM.
add code tags (the # button)


#9
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
That's not C or C++, probably Pascal. What language are you planning to do?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#10
jaymark

jaymark

    Newbie

  • Members
  • Pip
  • 7 posts
pascal

#11
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Moved to the correct forum.

It's not clear what your code is doing, since I only read English. What does the text file you're reading look like?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#12
jaymark

jaymark

    Newbie

  • Members
  • Pip
  • 7 posts
sorry, the commentaries are in russian that's why it's unreadable...