Questões da Prova SRH - 2015 - UERJ - Analista de Sistemas

Foram encontradas 4 questões

Resolva questões gratuitamente!

Junte-se a mais de 4 milhões de concurseiros!

Ano: 2015 Banca: SRH Órgão: UERJ Prova: SRH - 2015 - UERJ - Analista de Sistemas |
Q483298 Programação
                        Here’s the first line of code ever written by a US president

Barack Obama just became the first US president to write a line of computer code (assuming George W. Bush never secretly indulged in PHP). At the White House yesterday, Obama sat down with students who were learning the fundamentals of JavaScript, the popular programming language used to create most web pages.

The line he wrote was:

                  moveForward(100);

“So I make the F in higher case?” Obama asked, correctly observing that JavaScript is case sensitive. “Semicolon?” (That semicolon is optional, but Obama apparently has a knack for recognizing JavaScript best practices.)
Obama was playing with a Code.org tutorial based on the popular Disney movie Frozen. In his line of code, the President called a function-moveForward-pre-defined by Code.org for the exercise.
Calling a function in JavaScript is simple: write its name exactly as it has been defined, followed by parentheses that contain its “arguments.” In this case, a single argument tells the program how many pixels to move a Frozen character forward. Because it’s measured in pixels, the argument has to be a number. If Obama had written moveForward(“three steps”), the program would have failed, offering only a cryptic error message and exposing the president to the near-perpetual state of frustration most software developers live in.

“This is Elsa?” Obama asked, referring to the movie’s main character.

Obama was promoting Computer Science Education Week and Code.org’s Hour of Code campaign, which encourages kids to try programming for at least one hour. “It turns out the concepts are not that complicated,” Obama told the students at the White House, though his attempt to explain it suggested otherwise:

                  “The basic concept behind coding is that you take zeros and ones, you take two numbers, yes or no, and those can be translated into electrical messages that then run through the computer…. So all it’s doing is it’s saying yes or no over and over again, and the computer’s powerful enough that it can read a really long set of instructions really quickly.”

Something like that.

                                                            Disponível em: http://qz.com/308904/heres-the-first-line-of-code-ever-written-by-a-us-president/
                                                                                                            Quartz (9 de Dezembro de 2014) - Texto de Zachary M. Seward

O exercício de programação que o Presidente Obama estava fazendo tinha o objetivo de mover um personagem da Disney para frente. Para isso, a função moveForward deveria ser usada.
A distância que o personagem deveria ser movido para frente e os parâmetros da função são, respectivamente:
Alternativas
Ano: 2015 Banca: SRH Órgão: UERJ Prova: SRH - 2015 - UERJ - Analista de Sistemas |
Q483290 Programação
O interpretador de comandos bash permite a verificação do status do encerramento do último comando ou função executado no script. Um exemplo de trecho de código fonte que verifica o valor desse status é:
Alternativas
Ano: 2015 Banca: SRH Órgão: UERJ Prova: SRH - 2015 - UERJ - Analista de Sistemas |
Q483288 Programação
Suponha que no diretório /home/uerj/teste existam os subdiretórios d1, d2, d3, d4 e d5 e que, em cada um deles, exista um arquivo com o nome a.txt. Deseja-se fazer um script que mova o arquivo a.txt desses subdiretórios para o diretório /home/uerj/teste. Como todos os arquivos possuem o mesmo nome, deve-se renomeá-lo e adicionar o número do diretório ao nome do arquivo. Por exemplo, o arquivo /home/uerj/teste/d1/a.txt será movido para /home/uerj/teste/a1.txt enquanto que o arquivo /home/uerj/teste/d3/a.txt será movido para /home/uerj/teste/a3.txt.
O código do script que realiza esse procedimento é:
Alternativas
Ano: 2015 Banca: SRH Órgão: UERJ Prova: SRH - 2015 - UERJ - Analista de Sistemas |
Q483277 Programação
Em um ambiente jboss 6, pode-se acessar o console web de gerenciamento utilizando a seguinte porta padrão, pré-definida na instalação:
Alternativas
Respostas
1: A
2: A
3: C
4: D