Write a method called allDigitsOdd that returns whether every digit of a positive integer is odd. Return true if the number consists entirely of odd digits (1, 3, 5, 7, 9) and false if any of its digits are even (0, 2, 4, 6, 8). For example, the call allDigitsOdd(135319) returns true but allDigitsOdd(9145293) returns false.

Answers

Answer 1
Answer:

Answer:

Sample output:

Enter integer 3232423

true

Enter integer 12131231

false

Explanation:

Above is the output of the program and for the solution check the screenshots attach to understand clearly the program.

Thanks


Related Questions

If you have a list consisting of just numbers, then you can add all of the values in the list using the sum() function. If your list consists of some numbers and some values of other types (e.g., lists, strings, sets), the sum() function will fail. In this question, we're asking you to write a function that will sum all of the numbers in a list, ignoring the non-numbers. The function below takes one parameter: a list of values (value_list) of various types. The recommended approach for this: (1) create a variable to hold the current sum and initialize it to zero, (2) use a for loop to process each element of the list, (3) test each element to see if it is an integer or a float, and, if so, add its value to the current sum, (4) return the sum at the end. student.py 1 Hef sum_lengths(value_list): # Implement your function here. Be sure to indent your code block! Restore original file
What effects convert colors in a picture to a wide variety of hues?
Jill needs to create a chart for technology club that shows what percentage of total students in the school play video games. Which chart or graph should she use? Bar graph Column chart Line graph Pie chart
What are some methods of cyber bullying ?
Which of the following sorting algorithms is described by this text? "Take the item at index 1 and see if it is in order compared to the item at index 0. If it is not, then swap the two items. Next take the item at index 2 and compare it to the items at the lower indexes. Move items in the lower indexes to a higher one until you find the proper location to place the value so that it is in the correct order. Continue this process with all remaining indexes."a. Insertion sortb. Heap sortc. Merge sortd. Quick sorte. Selection sort

Consider the following functions: (4) int hidden(int num1, int num2) { if (num1 > 20) num1 = num2 / 10; else if (num2 > 20) num2 = num1 / 20; else return num1 - num2; return num1 * num2; } int compute(int one, int two) { int secret = one; for (int i = one + 1; i <= two % 2; i++) secret = secret + i * i; return secret; } What is the output of each of the following program segments? a. cout << hidden(15, 10) << endl; b. cout << compute(3, 9) << endl; c. cout << hidden(30, 20) << " " << compute(10, hidden(30, 20)) << endl; d. x = 2; y = 8; cout << compute(y, x) << endl;

Answers

Answer:

a.  cout<<hidden(15,10)<<endl;

output = 5

b. cout << compute(3, 9) << endl;

output=3

c. cout << hidden(30, 20) << " " << compute(10, hidden(30, 20)) << endl;

output = 10

d. x = 2; y = 8; cout << compute(y, x) << endl;

output= 8

Explanation:

solution a:

num1= 15;

num2= 10;

according to condition 1, num1 is not greater than 20. In condition 2, num2 is also not greater than 20.

so,

the solution is

return num1 - num2 = 15 - 10 = 5

So the output for the above function is 5.

solution b:

as in function there are two  integer type variables named as one and two. values of variables in given part are:

one = 3

two = 9

secret = one = 3

for (int i= one + 1 = 3+1 = 4; i<=9%2=1; i++ )

9%2 mean find the remainder for 9 dividing by 2 that is 1.

//  there 4 is not less than equal to  1 so loop condition will be false and loop will terminate. statement in loop will not be executed.

So the answer will be return from function compute is

return secret ;

secret = 3;

so answer return from the function is 3.

solution c:

As variables in first function are num1 and num2. the values given in part c are:

num1 = 30;

num2= 20;

According to first condition num1=30>20, So,

num1= num2/10

so the solution is

num1 = 20/10 = 2

now

num1=2

now the value return from function Hidden is,

return num1*num2 = 2* 20 = 40

Now use the value return from function hidden in function compute as

compute(10, hidden(30, 20))

as the value return from hidden(30, 20) = 40

so, compute function becomes

compute(10, 40)

Now variable in compute function are named as one and two, so the values are

one= 10;

two = 40;

as

secret = one

so

secret = 10;

for (int i= one + 1 = 10+1 = 11; i<=40%2=0; i++ )

40%2 mean find the remainder for 40 dividing by 2 that is 0.

//  there 11 is not less than equal to  0 so loop condition will be false and loop will terminate. statement in loop will not be executed.

So the answer will be return from function compute is

return secret ;

secret = 10;

so answer return from the function is 10.

solution d:

Now variable in compute function are named as one and two, so the values are

one = y = 8

two = x = 2

There

Secret = one = 8;

So

for (int i= one + 1 = 8+1 = 9; i<=2%2=0; i++ )

2%2 mean find the remainder for 2 dividing by 2 that is 0.

//  there 9 is not less than equal to  0 so loop condition will be false and loop will terminate. statement in loop will not be executed.

So the answer will be return from function compute is

return secret ;

secret = 8;

so answer return from the function is 8.

Blender questions6. In the default 3-D view, which of the following changes depending on what actions are being carried out on the screen, and acts as the roadmap? (1 point)

the pivot point

the toolbar area

the view editor

the info header



7. You cannot use the manipulator widget to translate, define, rotate, or scale an object. (1 point)

true

false

Answers

Blender questions
6. In the default 3-D view, which of the following changes depending on what actions are being carried out on the screen, and acts as the roadmap? (1 point)

the pivot point

the toolbar area

the view editor

the info header

The correct answer is:

the pivot point

7. You cannot use the manipulator widget to translate, define, rotate, or scale an object. (1 point)

true

false

The correct answer is:
false
The Transformation manipulator widgets allow mouse controlled translation, rotation and scaling in the3D View.

Write a program to complete the task given below: Ask the user to enter any 2 numbers in between 1-10 and add both of them to another variable call z. Use z for adding 30 into it and print the final result by using variable results.

Answers

Answer:

a = int(input("Enter first value between 1 - 10"))

b = int(input("Enter second value between 1 - 10"))

z = a + b

z += 30

print("The value of z = ", z)

Explanation:

The code is written above in python language to perform the given task.

Now, let us explain each statement of code.

Step 1: The first two lines take input from the user prompting the user to enter the values between 1 to 10.

Then the values are type casted to int using int().

The values are stored in variables a and b.

Step 2: Then, the values of a and b are added to get another variable z.

Step 3: The statement 'z += 30' is equivalent to z = z+30

It adds 30 to the variable z and stores it in the same variable z.

Step 4: Finally the value of variable 'z' is printed using print() command.

Interchanges of ideas in forums and internet news groups are functions of which domain?

Answers

I believe that the answer to the question provided above is that the  Interchanges of ideas in forums and internet news groups are functions of the information domain.
Hope my answer would be a great help for you.    If you have more questions feel free to ask here at Brainly.

The ticketing system at the airport is broken, and passengers have lined up to board the plane in the incorrect order. This line is represented in an ArrayList tickets in the AirLineTester class. Devise a way to separate passengers into the correct boarding groups. Currently, there is an AirlineTicket class that holds the information for each passengers ticket. They have a name, seat, row, and boarding group. Use the TicketOrganizer class to help fix the order of passengers boarding. First, create a constructor that takes an ArrayList of AirLineTickets and copies it to a class variable ArrayList. Then, create a getTickets method to get the ArrayList of AirLineTickets. In the TicketOrganizer class, create a method called printPassengersByBoardingGroup that prints out the name of the passengers organized by boarding group. The boarding groups go from 1-5, and have been predetermined for you. This should print the boarding group followed by all passengers in the group:

Answers

Answer:

See explaination

Explanation:

The program code

import java.util.ArrayList;

public class Main

{

public static void main(String[] args)

{

ArrayList<AirlineTicket> tickets = new ArrayList<AirlineTicket>();

//This creates a randomized list of passengers

addPassengers(tickets);

for(AirlineTicket elem: tickets)

{

System.out.println(elem);

}

//This creates a TicketOrganizer object

TicketOrganizer ticketOrganizer = new TicketOrganizer(tickets);

//These are the methods of the ticketOrganizer in action

System.out.println("\nPassengers Ordered by Boarding Group:");

ticketOrganizer.printPassengersByBoardingGroup();

System.out.println("\nPassengers in line who can board together:");

ticketOrganizer.canBoardTogether();

}

//Do not touch this method! It is adding random passengers to the AirlineTicket array

public static void addPassengers(ArrayList<AirlineTicket> tickets)

{

String[] seats = {"A","B","C","D","E","F"};

for(int index = 0; index< 15; index++)

{

int random = (int)(Math.random() * 5);

AirlineTicket ticket = new AirlineTicket("Passenger " + (index+1), seats[random], ((int)(Math.random()*5)+1), ((int)(Math.random()*8)+1));

tickets.add(ticket);

}

}

}

class TicketOrganizer

{

private ArrayList<AirlineTicket> tickets ;

//constructor with parameter as an arraylist of AirlineTicket

public TicketOrganizer(ArrayList<AirlineTicket> tickets)

{

this.tickets = tickets;

}

//methhods to return the arraylist of airlines

public ArrayList<AirlineTicket> getTickets()

{ //re-organize the ticket first

ArrayList<AirlineTicket> tickets_organized = new ArrayList<AirlineTicket>();

for(int i=1; i<=5; i++)

{

for(AirlineTicket ticket: tickets)

{

if(ticket.getBoardingGroup() == i)

{

tickets_organized.add(ticket);

}

}

}

return tickets_organized;

}

//print the tickets based on boardingGroup

public void printPassengersByBoardingGroup()

{

int count = 0;

for(int i=1; i<=5; i++)

{

System.out.println("Boarding Group " + i + ":");

for(AirlineTicket ticket : tickets)

{

if(ticket.getBoardingGroup() == i)

{

System.out.println("Passenger " + ticket.getName());

}

}

}

See attachment for sample output

Jason needs to design the colors for a web site that make it easy to read. Which should he consider using?O Contrasting background and text
Dark background and dark text
Dark background and light text
Similar background and text​

Answers

Answer: Dark background and light text.

Explanation:

Assuming when you mean by "light text", you mean by white text. This should be able to be readable by users visiting the site.

Answer:

Contrasting background and text

Explanation:

When selecting a color scheme for a website, designers often choose complementary colors that keep the visitor on the website.

Your web page should have three main colors: one for the background, one for the text, and one for the headings. The colors you select should complement each other and be on opposite sides of the color wheel.

Also i got it right on my test!

Other Questions