Java Practice It | Self-Check 2.38: loopTableSlashesConstant | for loop, loop table
Summary:
Math but more
More practice its:
https://youtube.com/playlist?list=PLZPy7sbFuWVgDWN1GImGRm_2Lh6IydaEH
Problem:
https://practiceit.cs.washington.edu/problem/view/bjp5/chapter2/s38-loopTableSlashesConstant
Question:
Suppose that a program has been written that produces the output shown below (and also shown in the previous Self-Check problem), a pattern of output consisting of lines of repeated characters \, !, and /. Now the author wants the program to be scalable using a class constant called SIZE. The previous output used a size of 6, since there were 6 lines:
Fill in the following equations for the number of each character relative to the line number for each type of character. There is a separate equation for size 6 and for size 4. Then once you have figured out both of these equations, find a general equation that uses the SIZE constant and would work for a figure of any size.
Fill in the following equations for the number of occurrences of the ! character on each line. We suggest that you write a table that lists the number of occurrences on each line that you can use to help find the equations from the output, as described in Chapter 2. Make one table for size 6, and another for size 4. (Some values will be the same at both sizes because they do not depend on the size.) Then once you have the equations for both sizes, look at the general pattern that uses the SIZE constant.
Compute the value of A, B, C, D, and E in the equations below. Assume that the lines are numbered from 1 through 6.
SIZE 6 (from the previous Self-Check problem):
number of ! = A * line + B
SIZE 4:
number of ! = A * line + C
General equation for any SIZE:
number of ! = A * line + (D * SIZE + E)
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Java Practice It | Self-Check 2.38: loopTableSlashesConstant | for loop, loop table», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.