1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
leonid [27]
3 years ago
6

Consider the following two code segments: Segment 1: while (k > 0) { System.out.println(k); k--; } --------------- Segment 2:

while (k > 0) { System.out.println(k); k--; } while (k > 0) { System.out.println(k); k--; } Assume that in both cases variable k has the same initial value. Under which of the following conditions will the two code segments produce identical output.

Computers and Technology
1 answer:
zepelin [54]3 years ago
6 0

Answer:

Always same value

Explanation:

These both code segments will always generate identical values given that we provide same value of k to both segments.

You can see attached pictures.

You might be interested in
What is one reason why a business may want to move entirely online?
andrezito [222]

Answer:

To focus on global market

Explanation:

Hope this helps! :)

3 0
2 years ago
Write a program that calculates the cost of a phone call. The user enters a positive integer that
san4es73 [151]
Add the following constants in the class definition, before the main method:

    private final static float START_COST = 1.5f;
    private final static float HIGH_TARIFF = 0.5f;
    private final static float LOW_TARIFF = 0.25f;
    private final static int FIXED_MINS = 2;
    private final static int HIGH_TARIFF_MINS = 10;

Then add this to the main method you already had:

        float price = START_COST;
        if (x > FIXED_MINS) {
            if (x <= HIGH_TARIFF_MINS) {
                price += HIGH_TARIFF*(x-FIXED_MINS);
            }
            else {
                price += HIGH_TARIFF*(HIGH_TARIFF_MINS-FIXED_MINS) 
                    + LOW_TARIFF*(x-HIGH_TARIFF_MINS);
            }
        }   
        System.out.printf("A %d minute call costs %.2f", x, price);      

5 0
2 years ago
Major findings of evolution of computers
Elis [28]

Answer:

twitt

Explanation:

3 0
3 years ago
Explica la importancia que tiene el plan de trabajo (cronograma) en los proyectos y porque se realiza antes de ejecutar la soluc
zysi [14]

Answer:

El plan de trabajo permite delimitar la necesidad a la cual se debe responder con una solución (<em>descripción del problema</em>), los hitos que se deben alcanzar (<em>objetivos general y específico</em>), los recursos requeridos para lograr desarrollar y aplicar la solución (<em>marco teórico</em>), los posibles beneficios derivados del proceso exitoso (<em>justificación del proyecto</em>) y una administración racional y realistas de los recursos a disposición en cuanto a disponibilidad, tiempo y personal mediante una secuenciación de tareas (i.e. <em>diagramas de Gantt</em>), todo reduce el componente iterativo inherente a diseño y producción de un producto, permite prever posibles imprevistos y mantener una perspectiva realista y una eficiencia aceptable en cuanto a presupuesto, metodologías y tecnologías a usar.

El plan de trabajo debe incluir principios de ingeniería concurrente para minimizar para manera mejor los posibles imprevistos, usualmente difíciles de manera con principios de ingeniería secuencial.

Explanation:

El plan de trabajo permite delimitar la necesidad a la cual se debe responder con una solución (<em>descripción del problema</em>), los hitos que se deben alcanzar (<em>objetivos general y específico</em>), los recursos requeridos para lograr desarrollar y aplicar la solución (<em>marco teórico</em>), los posibles beneficios derivados del proceso exitoso (<em>justificación</em>) y una administración racional y realistas de los recursos a disposición en cuanto a disponibilidad, tiempo y personal mediante una secuenciación de tareas (i.e. diagramas de Gantt), todo reduce el componente iterativo inherente a diseño y producción de un producto, permite prever posibles imprevistos y mantener una perspectiva realista y una eficiencia aceptable en cuanto a presupuesto, metodologías y tecnologías a usar.

El plan de trabajo debe incluir principios de ingeniería concurrente para minimizar para manera mejor los posibles imprevistos, usualmente difíciles de manera con principios de ingeniería secuencial.

5 0
3 years ago
List five ways in which the type declaration system of a language such as Java or C differs from the data definition language us
zhannawk [14.2K]

Answer:

Hi Sevanah! Below are the five main differences between a type declarative language and a data definition language:

A data definition language:

1. define data structure

2. define the column attributes of a table

3. no further classifications

4. The basic commands in a Data Definition language are CREATE, DROP, RENAME, ALTER

5. Scope of variables in data definition languages is limited  

A type declarative language:

1. manipulate the data itself

2. uses functions to add and update the rows of a table

3. further classified into procedural and non-procedural languages

4. The basic commands are INSERT, UPDATE and MERGE

5. Scope of variables in type declarative languages is varied

Explanation:

A data definition language is used to define data structures. It makes use of statements such as create table, alter table to create and alter the database schema to allow it to hold rows of information. A type declarative language such as Java or C is used to manipulate the data itself. For example, insert, update and deletion of rows to the database. Whereas data definition languages define the column attributes of a table, a type declaration language uses functions to add and update the rows of a table. A data definition language does not have any further classification, however a type declarative language can be further classified into procedural and non-procedural languages. The basic commands in a Data Definition language are CREATE, DROP, RENAME, ALTER, whereas the basic commands in a type declarative language are INSERT, UPDATE and MERGE. There is little of no scope of variables in a data definition language, whereas the scope of variables in type declarative languages is varied

8 0
3 years ago
Other questions:
  • If you “bury” a story on Digg, what have you done
    10·1 answer
  • What is transaction model?
    9·2 answers
  • How do emotions affect purchasing decisions?
    6·1 answer
  • Develop a C++ program that will determine whether a department store customer has exceeded the credit limit on a charge account.
    13·1 answer
  • A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the clie
    8·1 answer
  • What is the best motivation that you can do/give to make your employees stay? ​
    6·1 answer
  • You have a team member on a remote project who is not fluent in English and
    15·1 answer
  • Consider the following code using the posix pthreads api:
    14·1 answer
  • What are benefits of AI
    9·2 answers
  • joe is in the planning stages to make sure that an upcoming company promotion during a major sporting event will not overwhelm h
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!