Ciao a tutti ...![]()
eseguendo un esercizio mi sono bloccata a tale punto:
"It assigns the length of the sequence to another variable"
si riferisce ad una sequenza di Dna :-)
Qualcuno di voi sa come aiutarmi e i comandi da effettuare?
grazieee!!!
Ciao a tutti ...![]()
eseguendo un esercizio mi sono bloccata a tale punto:
"It assigns the length of the sequence to another variable"
si riferisce ad una sequenza di Dna :-)
Qualcuno di voi sa come aiutarmi e i comandi da effettuare?
grazieee!!!
Posta così la domanda è estremamente vaga... fornisci il codice che hai scritto finora e il testo dell'esercizio, altrimenti risulta difficile aiutarti.
Amaro C++, il gusto pieno dell'undefined behavior.
ed ecco cosa ho eseguito fino ad ora:Develop a Perl program that receives from the standard input one
aminoacid sequence and prints the length of the sequence and the
number of basic aminoacids contained in the sequence.
-It prints a message “Please insert an aminoacid sequence : ”
-It reads the aminoacid sequence from STDIN
-It substitutes all the white spaces and the newline character of the
sequence with the empty character.
-It checks with a pattern matching the sequence. If the sequence
contains characters different from the twenty aminoacids it gives an
error message.
-It assigns the length of the sequence to another variable.
-It counts the number of K+H+R.
-It prints the message “The typed sequence is”, followed by the length
of the sequence, followed by “ aminoacids long” followed by a new
line.
-It prints the message “It contains ”, followed by the number of
K+H+R, followed by “ basic aminoacids”, followed by new line”.
codice:#!/usr/bin/perl -w print "Please insert an aminoacid sequence : "; $sequence=<STDIN>; $sequence =~ s/\s//g; # if-elsif-else conditionals if($word eq 'J') { print "error\n"; } elsif($word eq 'O') { print "error\n"; } elsif ( $word eq 'U' ) { print "error\n"; } elsif ($word eq 'X' ) { print "error\n"; } exit;
ciao a tutti ...
al momento ho eseguito questi comandi con perl:
ADESSO DEVO: It assigns the length of the sequence to another variable.codice:#!/usr/bin/perl -w print "Please insert an aminoacid sequence : "; $sequence=<STDIN>; $sequence =~ s/\s//g; # if-elsif-else conditionals if($word eq 'J') { print "error\n"; } elsif($word eq 'O') { print "error\n"; } elsif ( $word eq 'U' ) { print "error\n"; } elsif ($word eq 'X' ) print "error\n"; } exit;
il comando:
è giusto???codice:$sequence = lenght($sequence)
grazie!!!
risolto ....![]()
Ho unito le due discussioni (dato che sostanzialmente erano sullo stesso tema) e aggiunto i tag [code] ... [/code], in modo da non perdere l'indentazione; in futuro ricordatene da te.![]()
Amaro C++, il gusto pieno dell'undefined behavior.