Write a method printOdds1To11 that prints the odd numbers between 1 and 11 inclusive, one on each line. The program should calculate the odd numbers in a loop. The program text should not include the digits 3, 5, 7, or 9, but it will print these numbers out using System.out.println along with 1 and 11, in numerical order. It should only contain a single println statement. The program should take no arguments and return no value, just print things out.

Answers

Answer 1

Answer:

The method goes thus

static void printOdds1To11(){

for(int i = 1; i<=11;i++){

System.out.println(i);

}

}

Explanation:

This line defines the method

static void printOdds1To11(){

This line iterates from 1 to 11 with an increment of 2

for(int i = 1; i<=11;i+=2){

This line prints the odd number in this range

System.out.println(i);

}

}


Related Questions

1. Write a function named problem1 to simulate the purchases in a grocery store. Write statements to read the price of each item until you enter a terminal value to end the loop. Calculate the subtotal and add a sales tax of 8.75% to the subtotal. Return the subtotal, the amount of the sales tax, and the total. Call the function and display the return results. (25 pts)​

Answers

Answer:

ok

Explanation:

What will be the output of the following program? Assume the user responds with a 5.

answer = input ("How many hamburgers would you like? ")
priceBurger = 3.00
intNumberBurgers = float(answer)
moneyDue = intNumberBurgers * priceBurger
print ("You owe $", moneyDue)

An error occurs.

You owe $15.0

You owe $ 15.0

You owe $ moneyDue

Answers

The output will be: You owe $ 15.0

The output of the following program, when the user responds with a 5 is You owe $15.0. The correct option is b.

What is the output?

Programs require the entry of data. This data is utilized by the software, which then produces data (or information). The output of software or other electronic device is whatever information it processes and transmits.

Anything that appears on the computer screen, like the text you type on the keyboard, is considered the output.

The floating-point value of "answer" is how many hamburgers would you like is set to a string indicating the response when someone responds to an input; in this case, the value is 5.

As a result, if the user responds with 5, the amount due is set to the price times the hamburger price:

You owe $", money Due = 3.00 x 5 = 15.00

Therefore, the correct option is b. You owe $15.0.

To learn more about output, refer to the below link:

https://brainly.com/question/28903099

#SPJ5

All of the different devices on the internet have unique addresses.

Answers

Answer:

Yes

Explanation:

Just like a human fingerprint, no 2 computers are the same.

PLEASE help me I will really appreciate it​

Answers

D)high speed data link
F)DSL
B)T3 line
C) T1 line
G) IPV4
I) lan connection
A) network
H) HTTP
J) domain name and structure
E) cable

Your program is going to compare the distinct salaries of two individuals for the last 5 years. If the salary for the two individual for a particular year is exactly the same, you should print an error and make the user enter both the salaries again for that year. (The condition is that there salaries should not be the exact same).Your program should accept from the user the salaries for each individual one year at a time. When the user is finished entering the salaries, the program should print which individual made the highest total salary over the 5 year period. This is the individual whose salary is the highest.You have to use arrays and loops in this assignment.In the sample output examples, what the user entered is shownin italics.Welcome to the winning card program.
Enter the salary individual 1 got in year 1>10000
Enter the salary individual 2 got in year 1 >50000
Enter the salary individual 1 got in year 2 >30000
Enter the salary individual 2 got in year 2 >50000
Enter the salary individual 1 got in year 3>35000
Enter the salary individual 2 got in year 3 >105000
Enter the salary individual 1 got in year 4>85000
Enter the salary individual 2 got in year 4 >68000
Enter the salary individual 1 got in year 5>75000
Enter the salary individual 2 got in year 5 >100000
Individual 2 has the highest salary

Answers

In python:

i = 1

lst1 = ([])

lst2 = ([])

while i <= 5:

   person1 = int(input("Enter the salary individual 1 got in year {}".format(i)))

   person2 = int(input("Enter the salary individual 1 got in year {}".format(i)))

   lst1.append(person1)

   lst2.append(person2)

   i += 1

if sum(lst1) > sum(lst2):

   print("Individual 1 has the highest salary")

else:

   print("Individual 2 has the highest salary")

This works correctly if the two individuals do not end up with the same salary overall.

3.4 Code Practice: Question 1

Answers

Answer:

color = input("What color? ")

if (color == "yellow"):

   print("Correct!")

else:

   print("Nope")

Explanation:

My code is dependent on if the color is supposed to be case sensitive

Defining the components of the system and how these components are related to each other is part of the:____________.a. architectural design phase.b. detailed design phase.c. requirements phase.d. All of these are correct

Answers

Answer:

a. architectural design phase.

Explanation:

Architectural design phase basically deals with the interaction between the very important and essential modules of the software system that is to be developed.

Hence, defining the components of the system and how these components are related to each other is part of the architectural design phase. These components include the input, process, and output, they are linked to their respective interface in order to establish the functionality and framework of the software system.

Office suites are also known as suites.

Lotus

utility

productivity

symphony

Answers

Office suites are also known as productivity suites.

What are office suites also known as?

An office suite is also known as to  be a kind of office application suite or office productivity software.

Note that Office suites are also known as productivity suites as it is where a lot of decisions are made that enhances productivity.

Learn more about suites from

https://brainly.com/question/5080206

#SPJ6

Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both single words. Then the program outputs last name, comma, first name. End with newline. Example output if the input is: Maya Jones Jones, Maya

Answers

Answer:

Written in Python:

import re

name = input("Name: ")

print(re.sub("[ ]", ", ", name))

Explanation:

This line imports the regular expression library

import re

This line prompts user for input

name = input("Name: ")

This line replace the space with comma and prints the output

print(re.sub("[ ]", ", ", name))

What are the negative impacts of cloud computing? Answer this question using examples, in at least 6-8 full sentences.

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

There are many benefits of cloud computing, but despite having benefits, there are many negative impacts of cloud computing.

The most known negative impact of cloud computing are given below:

Data confidentiality risk:

when you are using cloud computing services, that means you are handing over your all information over the internet. There is a risk of data confidentiality in this context, your data's security is totally dependent on the service provider. If your service provider security breaches, then your business reputation will also get impacted because your confidential data is managed and controlled by the service provider whose security is breached by someone or hackers.

Depend on internet connection:

Another disadvantage is that if you are working in a developing or under-developed country and you are using cloud computing services. Then your all business managing is relying on the internet. As you know, in developing countries internet speed does matter 24/7 and it is not as fast as required to use cloud computing services for your business.

Data mobility Issue:

Data mobility refers to sharing data between cloud services and in case if the user terminates their services of cloud computing then how you can handle such a situation.

Live help Issue:

some cloud service providers provide you the services online and help you online if you find any error in your services, imagine if in your company 24/7 IT staffs are working on a project, then how you can handle if an error occurs in your cloud computing services and online help also not available. so in this case cloud computing impact negatively your project and organization.  

Sukhi needs to insert a container into her form to collect a particular type of information.

Which object should she insert?

Answers

Answer:

text box

Explanation:

on edge 2020

Answer:

A- text box

Explanation: ;)

Remember to check the on your vehicle first to see if a repair is covered by the manufacturer.

Answers

Answer:

insurance or warranty

Explanation:

It should be insurance because insurance can cover things like car repairs and other things that goes wrong. warranty could work too because it kind of means the same thing.

When you check to see how much RAM, or temporary storage you have available, you are checking your _____.

primary memory

secondary storage

secondary memory

tertiary storage

Answers

When you check to see how much RAM, or temporary storage you have available, you are checking your primary memory.

The correct option is first.

What is drive?

Drive provides a storage space and speed for processing the data in the drive on the personal computers or laptops at low cost.

RAM, also known as Random Access Memory, is storage drive which is temporary but primary.

So, RAM is considered as primary memory.

Thus, when you check to see how much RAM, or temporary storage you have available, you are checking your primary memory.

Learn more about drive.

https://brainly.com/question/10677358

#SPJ2

Which is true of diagnosing and troubleshooting? Diagnosing attempts to identify the source of a problem, while troubleshooting looks for the nature of the problem. Diagnosing is used to fix problems with hardware, while troubleshooting is used to fix problems in program code. Diagnosing looks for the nature of the problem, while troubleshooting attempts to identify the source of the problem. Diagnosing is used to fix problems in program code, while troubleshooting is used to fix problems with hardware.

Answers

Answer:

the answer is c

Explanation:

i just took the test

Answer:c

Explanation: because Diagnosing looks for the nature of the problem, while troubleshooting attempts to identify the source of the problem.

Define a Python function named matches that has two parameters. Both parameters will be lists of ints. Both lists will have the same length. Your function should use the accumulator pattern to return a newly created list. For each index, check if the lists' entries at that index are equivalent. If the entries are equivalent, append the literal True to your accumulator. Otherwise, append the literal False to your accumulator.

Answers

Answer:

The function in Python is as follows:

def match(f1,f2):

    f3 = []

    for i in range(0,len(f1)):

         if f1[i] == f2[i]:

              f3.append("True")

         else:

         f3.append("False")

    print(f3)

Explanation:

This line defines the function

def match(f1,f2):

This line creates an empty list

    f3 = []

This line is a loop that iterates through the lists f1 and f2

    for i in range(0,len(f1)):

The following if statement checks if corresponding elements of both lists are the same

         if f1[i] == f2[i]:

              f3.append("True")

If otherwise, this is executed

         else:

         f3.append("False")

This prints the newly generated list

    print(f3)

Which of the following may be stored in an
e-mail address book? Check all of the boxes that
apply.
names
e-mail addresses
physical addresses
subjects of e-mails
fax numbers

Answers

Answer:

names, email addresses, subjects of e-mails

Explanation:

Answer:

names

e-mail addresses

physical addresses

fax numbers

Explanation:

correct answers

Cable television systems originated with the invention of a particular component. What was this component called?​

Answers

Answer:

Cable television is a system of delivering television programming to consumers via radio frequency (RF) signals transmitted through coaxial cables, or in more recent systems, light pulses through fibre-optic cables. This contrasts with broadcast television (also known as terrestrial television), in which the television signal is transmitted over the air by radio waves and received by a television antenna attached to the television; or satellite television, in which the television signal is transmitted by a communications satellite orbiting the Earth and received by a satellite dish on the roof. FM radio programming, high-speed Internet, telephone services, and similar non-television services may also be provided through these cables. Analog television was standard in the 20th century, but since the 2000s, cable systems have been upgraded to digital cable operation.

Explanation:

[tex]hii[/tex]have a nice day ✌️✌️

Cable television systems originated with the invention of a particular component. The component is a coaxial cable. The correct option is A.

What is a cable television system?

Radiofrequency (RF) signals are transferred through coaxial cables, or in more current systems, light pulses are transmitted through fiber-optic cables, to deliver television programming to viewers via cable television networks.

This is in contrast to satellite television, which transmits the television signal via a communications satellite orbiting the Earth and receives it via a satellite dish.

It broadcast television, in which the television signal is transmitted over the air by radio waves and received by a television antenna attached to the television.

Therefore, the correct option is A. coaxial cable.

To learn more about the cable television system, refer to the link:

https://brainly.com/question/29059599

#SPJ2

The question is incomplete. Your most probably complete question is given below:

A. coaxial cable

B. analog transmission

C. digital transmission

D. community antenna

In ____________, a large IP address block could be divided into several contiguous groups and each group be assigned to smaller networks.

Answers

There are no answers given in this question

What name is given to the process or mechanism of granting or denying use of a resource typically applied to users or generic network traffic?

Answers

Answer:

Access control

Explanation:

A computer network connects two or more computer devices to communicate and share resources. When computers or workstations in a network are connected, data can be directly transferred from a source to a target workstation.

In most cases in an enterprise network, there is a need to restrict access to certain information or resources, so access control protocols are used to secure sensitive information from unauthorized view.

Write an if statement that assigns 20 to the variable y, and assigns 40 to the variable z if the variable x is greater than 100. python

Answers

Answer:

if x > 100:

    y = 20

    z = 40

Explanation:

This line checks if variable x is greater than 100

if x > 100:

This line assigns 20 to y

    y = 20

This line assigns 40 to z

    z = 40

The if statement that assigns 20 to the variable y, and assigns 40 to the variable z if the variable x is greater than 100 is as follows:

x = int(input("input an integer number: "))

if x > 100:

   y = 20

   z = 40

   print(y)

   print(z)

The first code we ask the user to input an integer number and stored it in the

variable x.

If the user input is greater than x, then y is assigned to 20 and z is assigned to 40.

We print the assigned value of y and z if the user entered an input greater

than 100.

learn more: https://brainly.com/question/19036769?referrer=searchResults

When investigators find evidentiary items that aren't specified in a warrant or under probable cause what type of doctrine applies

Answers

search it up and it’ll tell you what doctrines it applies too

Thomas has decided to key an agenda for the FBLA meeting using a column format. What is recommended to guide the reader’s eye and control the left to right flow or text?

Answers

Incomplete question. The full question reads;

Q. Thomas has decided to key an agenda for the FBLA meeting using a column format. What is recommended to guide the reader's eye and control the left-to-right flow of text?

Answer choices:

table featuredot leader tableft alignment tooldouble space

Answer:

dot leader tab

Explanation:

Indeed, Thomas could use the dot leader tab on MS word to guide the reader's eye and control the left-to-right flow of the text so the reader can note the agenda.

For example, below is a typical way the dot leader tab would look like on a document:

............... Agenda 1

............... Agenda 2

............... Agenda 3

A hammer has an input distance of 9 cm and an output distance is 3 cm what is the ideal mechanical advantage

Answers

Answer:

1/3

Explanation:

The Classic Triangle Testing Problem, (Myer's Triangle): A program reads three integer values. The three values are interpreted as representing the lengths of the sides of a triangle. The program prints a message that states whether the triangle is scalene, isosceles, or equilateral. Develop a set of test cases (at least 6 ) that you feel will adequately test this program. (This is a classic testing problem and you could find numerous explanations about it on the internet. I would recommend that you try to submit your own answer, based on your understanding of the topic)
Let’s define what the three different types of triangle requirements for the side’s lengths are:______.

Answers

Answer:

Here is the Python program:

def MyersTriangle(a, b, c):  #method to test triangles

     

    if not(isinstance(a, int) and isinstance(b, int) and isinstance(c, int)):  #checks if values are of type int

         return 'Enter integer values'  

         

    elif a==0 or b==0 or c==0: #checks if any value is equal to 0

         return 'Enter integer values greater than 0'

         

    elif a<0 or b<0 or c <0:  #checks if any value is less than 0

         return 'All values must be positive'

         

    elif not (a+b>=c and b+c>=a and c+a>=b):  #checks if triangle is valid

         return 'Not a valid triangle'

         

    elif a == b == c:  #checks if triangle is equilateral

         return 'triangle is equilateral'

         

    elif a == b or b == c:  #checks if triangle is isoceles

         return 'triangle is isoceles'

         

    elif a != b and a != c and b != c:  #checks if triangle is scalene

         return 'triangle is scalene'        

#test cases

print(MyersTriangle(2.4,7.5,8.7))  

print(MyersTriangle(0,0,0))

print(MyersTriangle(-1,5,4))

print(MyersTriangle(10,10,25))

print(MyersTriangle(5,5,5))

print(MyersTriangle(3,3,4))

print(MyersTriangle(3,4,5))

   

Explanation:

The program uses if elif conditions to check:

if the values are integers: this is checked by using isinstance method that checks if values belongs to a particular int. If this returns true then values are integers otherwise not

if values are not 0: this is checked by using logical operator or between each variable which checks if any of the values is 0

if values are not negative: This is checked by using relational operator < which means the values are less than 0

if values make a valid triangle: this is checked by the rule that the sum of two sided of the triangle is greater than or equal to the third side.

and then checks if the triangle is scalene, isosceles, or equilateral: This is checked by the following rules:

For scalene all three sides are unequal in length

For isosceles any of the two sides are equal in length

For equilateral all sides should be equal in length.

The screenshot of the program along with the output is attached.

Write a statement to create a new Thing object snack that has the name "potato chip". Write the statement below.

Answers

Answer:

New Thing = ("Potato Chip")

Explanation:

Java is a programming language which is used by IT professional for building enterprise applications. The new thing object can be named as potato chip by entering the command statement. The statement must be enclosed in the inverted commas for the application to understand the input.

Which option should you select to accept a tracked change?
OA. Accept
OB.
Reject
O c.
Review
OD
Delete

Answers

Accept is the answer

Walmart store wants to compare the sales of five of its stores. Write a complete program to ask the user to enter the sales for 5 stores. Create a bar chart displaying stars representing the sale amount for the day. must follow the requirements main method calls the print method. a for loop is required print method accepts an integer as its parameter representing the sale for the day. display stars based on the sale. one star represents $100 sale. a for loop is required Sample output:

Answers

Answer:

Here is the C++ program.

#include <iostream>  //to use input output functions

using namespace std;   //to identify objects cin cout

   void print(int sales){   //method that accepts integer as its parameter representing the sale for the day

          for(int i=0;i<(sales/100);i++){  //loop to create a bar chart

           cout<<"*";   }   }  //prints stars representing the sale amount for the day

   int main(){          

       int sales1;    // stores the sales of store 1

       int sales2;    // stores the sales of store 2

       int sales3;    // stores the sales of store 3

       int sales4;     // stores the sales of store 4

       int sales5;    // stores the sales for store  5    

       

       cout<<"Enter the sales for store 1: ";  //prompts user to enter sales for store 1

       cin >>sales1;  //reads the value of sales for store 1 and stores it in sales1

       print(sales1);  //calls print method to display start representing the sales amount for the day for store 1

       cout<<"\nEnter the sales for store 2: ";  //prompts user to enter sales for store 2

     cin >>sales2;  //reads the value of sales for store 2 and stores it in sales2

       print(sales2); //calls print method to display start representing the sales amount for the day for store 2

       cout<<"\nEnter the sales for store 3: ";  //prompts user to enter sales for store 3

     cin >>sales3;  //reads the value of sales for store 3 and stores it in sales3

       print(sales3);  //calls print method to display start representing the sales amount for the day for store 3

       cout<<"\nEnter the sales for store 4: ";  //prompts user to enter sales for store 4

     cin >>sales4;  //reads the value of sales for store 4 and stores it in sales4

       print(sales4);  //calls print method to display start representing the sales amount for the day for store 4

       cout<<"\nEnter the sales for store 5: ";  //prompts user to enter sales for store 5

     cin >>sales5;  //reads the value of sales for store 5 and stores it in sales5

       print(sales5);     } //calls print method to display start representing the sales amount for the day for store 5

Explanation:

The program is well explained in the comments attached with each line of the program. Lets say user enters 100 as sales for store 1. Then the for loop works as follows:

for(int i=0;i<(sales/100);i++)

At first iteration:

i = 0

i<(sales/100) is true because 0 is less than 100/100 = 1

so the program moves to the body of loop which has the statement:

cout<<"*"

This prints one asterisk one output screen. Next the loop breaks when i = 1. So this only prints one asterisk in output since one star represents $100 sale. The screenshot of the program along with its output is attached.

Write a program called DeliveryCharges for the package delivery service in Exercise 4. The program should again use an array that holds the 10 zip codes of areas to which the company makes deliveries. Create a parallel array containing 10 delivery charges that differ for each zip code. Prompt a user to enter a zip code, and then display either a message indicating the price of delivery to that zip code or a message indicating that the company does not deliver to the requested zip code.

Answers

Answer:

zip_codes = ["11111", "22222", "33333", "44444", "55555", "66666", "77777", "88888", "99999", "00000"]

charges = [3.2, 4, 1.95, 5.7, 4.3, 2.5, 3.8, 5.1, 6.6, 7.3]

deliver = False

index = -1

zip_code = input("Enter the zip code: ")

for i in range(len(zip_codes)):

   if zip_code == zip_codes[i]:

       deliver = True

       index = i

       break

if deliver:

       print("The charge of delivery to " + zip_codes[index] + " is $" + str(charges[index]))

else:

   print("There is no delivery to " + zip_code)

Explanation:

*The code is in Python.

Initialize the zip_codes array with 10 zip codes

Initialize the charges array with 10 corresponding values

Initialize the deliver as False, this will be used to check if the zip code is in the zip_codes

Initialize the index, this will be used if the zip code is a valid one, we will store its index

Ask the user to enter the zip_code

Create a for loop that iterates the length of the zip_codes array. Inside the loop:

Check if the zip_code is equal to the any of the items in the zip_codes. If it is, set the deliver as True, set the index as i, and break

When the loop is done, check the deliver. If it is True, then print the charge of the delivery. Otherwise, print that there is no delivery to that zip code

Hi Guys

I have a Computer Science question. Please answer it as soon as possible.

I do not care about the working - I just care about the answer.

10 points guys

Thanks
Me.

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The answer to this question is given in the attached file.

This is the code that runs for-loop. This loop iterates 5 times and print the value of z variable and even. if value of i variable then it print "even" and z value. else it print z value.

The state way of grading drivers is called what?

*

Answers

Oh yeah I forgot what you did you do that I mean yeah I forgot to tell you something about you lol lol I don’t want to see it anymore
Other Questions
What were the weaknesses of the Articles of Confederation? Check all that apply. ASAP MULTIPLE CHOICE WILL MARK BRAINLIESTWhich statement is a fact about nutrition products?Avocados can cure heart disease.Beef is a good source of iron and protein.Eggs provide all the nutrition that a person needs.Diet soda is good for you. If you have an orientation where you read manuals and fill out paperwork, it is probably a _________.A. new hire orientationB. interactive orientationC. reorientationD. mentorship Short Term- What do I want to achieve in the next several weeks?WHAT ARE SOME SHORT TERM GOALS Read the passage and then answer the following question. En la cafetera de la escuela cada persona tiene su comida favorita.A Luis le gustan las manzanas rojas. Para Andrea la sanda es su favorita.A Camilo le gusta la carne y a Adriana le gustan las uvas.Who is the person who likes red apples?AndreaCamiloAdrianaLuis If a rock falls for 5 seconds near the surface of the earth and with no air friction, it will reach a velocity of Two cities on a map is 7.5 centimeters.The map is 1 centimeter represents 30 kilometers.What is the distance between the cities in kilometers? A van moves 100 km in 2 1/2 hours.What is its average speed in kilometersper hour? Describe the composition in this photo and how it is used effectively. *Your answer Imagine you are rolling a marble down a wooden ramp for an experiment. What are some variables you can experiment with to increase the velocity of the marble? * A store has 7 blue chairs for $127.75 or 4 red chairs for $73.52. Which color chair has a higher cost per chair? Which civilization is located between the Tigris and Euphrates rivers? Which of the following is NOT a part of ALL cells?a.ribosomesb.cell wallc.endoplasmic reticulumd.cytoplasm Kane is training for a marathon. He starts by running 3 miles during every training session.Each week plans to increase the distance of his run by mile.1/4Let w be the number of weeks. Write an expression to show the distance Kaneruns in a training session after w weeks. Read and reread the excerpt from We Shall Not Be Moved. The officers of Local 25 sent them on to the owners along with one more demand, recognition of the union. This came to mean the "closed shop." Only union members can work in a closed shop, since the only way to set uniform wages and standards is to have the union do it; otherwise employers would always try to undercut one another. And the union can standardize the industry only when it controls the supply of labor through the union shop. What is the meaning of a "closed shop"? PLZ HELP QUICKLY!The diagram below describes events leading to the Declaration of Independence. Which is the most likely reason for an event that could fill Box 2?A. The Boston Tea Party happens in Massachusetts.B.The British lose the French and Indian War.C.The Chesapeake Bay is closed to all shipping.D.The French and Indian war was expensive. Which sentence can represent the inequality Why is a certain location on the Mississippi River known as English Turn? Welp third try since no one answered mine again (Will give Brainliest) What is the pH of a solution made by mixing 0.050 mol of NaCN with enough water to make a liter of solution